diff options
Diffstat (limited to 'node_modules/locutus/php/strings/implode.js')
-rw-r--r-- | node_modules/locutus/php/strings/implode.js | 38 |
1 files changed, 0 insertions, 38 deletions
diff --git a/node_modules/locutus/php/strings/implode.js b/node_modules/locutus/php/strings/implode.js deleted file mode 100644 index 3bbcae3..0000000 --- a/node_modules/locutus/php/strings/implode.js +++ /dev/null @@ -1,38 +0,0 @@ -'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
\ No newline at end of file |