'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; module.exports = function implode(glue, pieces) { // discuss at: http://locutus.io/php/implode/ // original by: Kevin van Zonneveld (http://kvz.io) // improved by: Waldo Malqui Silva (http://waldo.malqui.info) // improved by: Itsacon (http://www.itsacon.net/) // bugfixed by: Brett Zamir (http://brett-zamir.me) // example 1: implode(' ', ['Kevin', 'van', 'Zonneveld']) // returns 1: 'Kevin van Zonneveld' // example 2: implode(' ', {first:'Kevin', last: 'van Zonneveld'}) // returns 2: 'Kevin van Zonneveld' var i = ''; var retVal = ''; var tGlue = ''; if (arguments.length === 1) { pieces = glue; glue = ''; } if ((typeof pieces === 'undefined' ? 'undefined' : _typeof(pieces)) === 'object') { if (Object.prototype.toString.call(pieces) === '[object Array]') { return pieces.join(glue); } for (i in pieces) { retVal += tGlue + pieces[i]; tGlue = glue; } return retVal; } return pieces; }; //# sourceMappingURL=implode.js.map