diff options
author | Marvin Borner | 2018-11-07 22:10:16 +0100 |
---|---|---|
committer | Marvin Borner | 2018-11-07 22:10:17 +0100 |
commit | 954583f3d56fbfb60321725f13ad092e536e3737 (patch) | |
tree | a0505a763797582c61fd8c2f90b422456d8874c9 /node_modules/locutus/php/array/array_combine.js | |
parent | 1c355e6e956a4e507ed5436d0c814ba9c3a1deb2 (diff) |
Removed node_modules
Diffstat (limited to 'node_modules/locutus/php/array/array_combine.js')
-rw-r--r-- | node_modules/locutus/php/array/array_combine.js | 46 |
1 files changed, 0 insertions, 46 deletions
diff --git a/node_modules/locutus/php/array/array_combine.js b/node_modules/locutus/php/array/array_combine.js deleted file mode 100644 index 124f5fa..0000000 --- a/node_modules/locutus/php/array/array_combine.js +++ /dev/null @@ -1,46 +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 array_combine(keys, values) { - // eslint-disable-line camelcase - // discuss at: http://locutus.io/php/array_combine/ - // original by: Kevin van Zonneveld (http://kvz.io) - // improved by: Brett Zamir (http://brett-zamir.me) - // example 1: array_combine([0,1,2], ['kevin','van','zonneveld']) - // returns 1: {0: 'kevin', 1: 'van', 2: 'zonneveld'} - - var newArray = {}; - var i = 0; - - // input sanitation - // Only accept arrays or array-like objects - // Require arrays to have a count - if ((typeof keys === 'undefined' ? 'undefined' : _typeof(keys)) !== 'object') { - return false; - } - if ((typeof values === 'undefined' ? 'undefined' : _typeof(values)) !== 'object') { - return false; - } - if (typeof keys.length !== 'number') { - return false; - } - if (typeof values.length !== 'number') { - return false; - } - if (!keys.length) { - return false; - } - - // number of elements does not match - if (keys.length !== values.length) { - return false; - } - - for (i = 0; i < keys.length; i++) { - newArray[keys[i]] = values[i]; - } - - return newArray; -}; -//# sourceMappingURL=array_combine.js.map
\ No newline at end of file |