diff options
Diffstat (limited to 'node_modules/locutus/php/array/array_shift.js.map')
-rw-r--r-- | node_modules/locutus/php/array/array_shift.js.map | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/node_modules/locutus/php/array/array_shift.js.map b/node_modules/locutus/php/array/array_shift.js.map new file mode 100644 index 0000000..3a83c19 --- /dev/null +++ b/node_modules/locutus/php/array/array_shift.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/php/array/array_shift.js"],"names":["module","exports","array_shift","inputArr","_checkToUpIndices","arr","ct","key","undefined","tmp","length","shift"],"mappings":";;AAAAA,OAAOC,OAAP,GAAiB,SAASC,WAAT,CAAsBC,QAAtB,EAAgC;AAAE;AACjD;AACA;AACA;AACA;AACA;AACA;;AAEA,MAAIC,oBAAoB,SAApBA,iBAAoB,CAAUC,GAAV,EAAeC,EAAf,EAAmBC,GAAnB,EAAwB;AAC9C;AACA;AACA;AACA;AACA,QAAIF,IAAIC,EAAJ,MAAYE,SAAhB,EAA2B;AACzB,UAAIC,MAAMH,EAAV;AACAA,YAAM,CAAN;AACA,UAAIA,OAAOC,GAAX,EAAgB;AACdD,cAAM,CAAN;AACD;AACDA,WAAKF,kBAAkBC,GAAlB,EAAuBC,EAAvB,EAA2BC,GAA3B,CAAL;AACAF,UAAIC,EAAJ,IAAUD,IAAII,GAAJ,CAAV;AACA,aAAOJ,IAAII,GAAJ,CAAP;AACD;;AAED,WAAOH,EAAP;AACD,GAjBD;;AAmBA,MAAIH,SAASO,MAAT,KAAoB,CAAxB,EAA2B;AACzB,WAAO,IAAP;AACD;AACD,MAAIP,SAASO,MAAT,GAAkB,CAAtB,EAAyB;AACvB,WAAOP,SAASQ,KAAT,EAAP;AACD;AACF,CAjCD","file":"array_shift.js","sourcesContent":["module.exports = function array_shift (inputArr) { // eslint-disable-line camelcase\n // discuss at: http://locutus.io/php/array_shift/\n // original by: Kevin van Zonneveld (http://kvz.io)\n // improved by: Martijn Wieringa\n // note 1: Currently does not handle objects\n // example 1: array_shift(['Kevin', 'van', 'Zonneveld'])\n // returns 1: 'Kevin'\n\n var _checkToUpIndices = function (arr, ct, key) {\n // Deal with situation, e.g., if encounter index 4 and try\n // to set it to 0, but 0 exists later in loop (need to\n // increment all subsequent (skipping current key, since\n // we need its value below) until find unused)\n if (arr[ct] !== undefined) {\n var tmp = ct\n ct += 1\n if (ct === key) {\n ct += 1\n }\n ct = _checkToUpIndices(arr, ct, key)\n arr[ct] = arr[tmp]\n delete arr[tmp]\n }\n\n return ct\n }\n\n if (inputArr.length === 0) {\n return null\n }\n if (inputArr.length > 0) {\n return inputArr.shift()\n }\n}\n"]}
\ No newline at end of file |