summaryrefslogtreecommitdiff
path: root/node_modules/locutus/php/array/array_splice.js.map
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/locutus/php/array/array_splice.js.map')
-rw-r--r--node_modules/locutus/php/array/array_splice.js.map1
1 files changed, 0 insertions, 1 deletions
diff --git a/node_modules/locutus/php/array/array_splice.js.map b/node_modules/locutus/php/array/array_splice.js.map
deleted file mode 100644
index 4027e16..0000000
--- a/node_modules/locutus/php/array/array_splice.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"sources":["../../../src/php/array/array_splice.js"],"names":["module","exports","array_splice","arr","offst","lgth","replacement","isInt","require","_checkToUpIndices","ct","key","undefined","tmp","length","Object","prototype","toString","call","lgt","rmvd","rmvdObj","replCt","intCt","returnArr","rmvdCt","parseInt","push","unshift","Array","splice","apply"],"mappings":";;;;AAAAA,OAAOC,OAAP,GAAiB,SAASC,YAAT,CAAuBC,GAAvB,EAA4BC,KAA5B,EAAmCC,IAAnC,EAAyCC,WAAzC,EAAsD;AAAE;AACvE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,MAAIC,QAAQC,QAAQ,eAAR,CAAZ;;AAEA,MAAIC,oBAAoB,SAApBA,iBAAoB,CAAUN,GAAV,EAAeO,EAAf,EAAmBC,GAAnB,EAAwB;AAC9C;AACA;AACA;AACA;AACA,QAAIR,IAAIO,EAAJ,MAAYE,SAAhB,EAA2B;AACzB,UAAIC,MAAMH,EAAV;AACAA,YAAM,CAAN;AACA,UAAIA,OAAOC,GAAX,EAAgB;AACdD,cAAM,CAAN;AACD;AACDA,WAAKD,kBAAkBN,GAAlB,EAAuBO,EAAvB,EAA2BC,GAA3B,CAAL;AACAR,UAAIO,EAAJ,IAAUP,IAAIU,GAAJ,CAAV;AACA,aAAOV,IAAIU,GAAJ,CAAP;AACD;AACD,WAAOH,EAAP;AACD,GAhBD;;AAkBA,MAAIJ,eAAe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Ia,aAAajB,MAAMI,GAAN,CAAjB,EAA6B;AAC3BS,aAAKO,IAAL,CAAUxB,IAAIQ,GAAJ,CAAV;AACA;AACAU,gBAAQI,QAAR,IAAoBtB,IAAIQ,GAAJ,CAApB;AACD,OAJD,MAIO;AACLU,gBAAQV,GAAR,IAAeR,IAAIQ,GAAJ,CAAf;AACAa,oBAAY,KAAZ;AACD;AACD;AACA;AACA,UAAIlB,eAAeA,YAAY,EAAEgB,MAAd,CAAnB,EAA0C;AACxCnB,YAAIQ,GAAJ,IAAWL,YAAYgB,MAAZ,CAAX;AACD,OAFD,MAEO;AACL,eAAOnB,IAAIQ,GAAJ,CAAP;AACD;AACF;AACD;AACA;AACA,WAAOa,YAAYJ,IAAZ,GAAmBC,OAA1B;AACD;;AAED,MAAIf,WAAJ,EAAiB;AACfA,gBAAYsB,OAAZ,CAAoBxB,KAApB,EAA2BC,IAA3B;AACA,WAAOwB,MAAMb,SAAN,CAAgBc,MAAhB,CAAuBC,KAAvB,CAA6B5B,GAA7B,EAAkCG,WAAlC,CAAP;AACD;;AAED,SAAOH,IAAI2B,MAAJ,CAAW1B,KAAX,EAAkBC,IAAlB,CAAP;AACD,CApHD","file":"array_splice.js","sourcesContent":["module.exports = function array_splice (arr, offst, lgth, replacement) { // eslint-disable-line camelcase\n // discuss at: http://locutus.io/php/array_splice/\n // original by: Brett Zamir (http://brett-zamir.me)\n // input by: Theriault (https://github.com/Theriault)\n // note 1: Order does get shifted in associative array input with numeric indices,\n // note 1: since PHP behavior doesn't preserve keys, but I understand order is\n // note 1: not reliable anyways\n // note 1: Note also that IE retains information about property position even\n // note 1: after being supposedly deleted, so use of this function may produce\n // note 1: unexpected results in IE if you later attempt to add back properties\n // note 1: with the same keys that had been deleted\n // example 1: var $input = {4: \"red\", 'abc': \"green\", 2: \"blue\", 'dud': \"yellow\"}\n // example 1: array_splice($input, 2)\n // returns 1: {4: \"red\", 'abc': \"green\"}\n // example 2: var $input = [\"red\", \"green\", \"blue\", \"yellow\"]\n // example 2: array_splice($input, 3, 0, \"purple\")\n // returns 2: []\n // example 3: var $input = [\"red\", \"green\", \"blue\", \"yellow\"]\n // example 3: array_splice($input, -1, 1, [\"black\", \"maroon\"])\n // returns 3: [\"yellow\"]\n // test: skip-1\n\n var isInt = require('../var/is_int')\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,\n // since 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 return ct\n }\n\n if (replacement && typeof replacement !== 'object') {\n replacement = [replacement]\n }\n if (lgth === undefined) {\n lgth = offst >= 0 ? arr.length - offst : -offst\n } else if (lgth < 0) {\n lgth = (offst >= 0 ? arr.length - offst : -offst) + lgth\n }\n\n if (Object.prototype.toString.call(arr) !== '[object Array]') {\n /* if (arr.length !== undefined) {\n // Deal with array-like objects as input\n delete arr.length;\n } */\n var lgt = 0\n var ct = -1\n var rmvd = []\n var rmvdObj = {}\n var replCt = -1\n var intCt = -1\n var returnArr = true\n var rmvdCt = 0\n // var rmvdLngth = 0\n var key = ''\n // rmvdObj.length = 0;\n for (key in arr) {\n // Can do arr.__count__ in some browsers\n lgt += 1\n }\n offst = (offst >= 0) ? offst : lgt + offst\n for (key in arr) {\n ct += 1\n if (ct < offst) {\n if (isInt(key)) {\n intCt += 1\n if (parseInt(key, 10) === intCt) {\n // Key is already numbered ok, so don't need to change key for value\n continue\n }\n // Deal with situation, e.g.,\n _checkToUpIndices(arr, intCt, key)\n // if encounter index 4 and try to set it to 0, but 0 exists later in loop\n arr[intCt] = arr[key]\n delete arr[key]\n }\n continue\n }\n if (returnArr && isInt(key)) {\n rmvd.push(arr[key])\n // PHP starts over here too\n rmvdObj[rmvdCt++] = arr[key]\n } else {\n rmvdObj[key] = arr[key]\n returnArr = false\n }\n // rmvdLngth += 1\n // rmvdObj.length += 1;\n if (replacement && replacement[++replCt]) {\n arr[key] = replacement[replCt]\n } else {\n delete arr[key]\n }\n }\n // Make (back) into an array-like object\n // arr.length = lgt - rmvdLngth + (replacement ? replacement.length : 0);\n return returnArr ? rmvd : rmvdObj\n }\n\n if (replacement) {\n replacement.unshift(offst, lgth)\n return Array.prototype.splice.apply(arr, replacement)\n }\n\n return arr.splice(offst, lgth)\n}\n"]} \ No newline at end of file