summaryrefslogtreecommitdiff
path: root/node_modules/locutus/php/array/array_reduce.js.map
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/locutus/php/array/array_reduce.js.map')
-rw-r--r--node_modules/locutus/php/array/array_reduce.js.map1
1 files changed, 1 insertions, 0 deletions
diff --git a/node_modules/locutus/php/array/array_reduce.js.map b/node_modules/locutus/php/array/array_reduce.js.map
new file mode 100644
index 0000000..5910fb8
--- /dev/null
+++ b/node_modules/locutus/php/array/array_reduce.js.map
@@ -0,0 +1 @@
+{"version":3,"sources":["../../../src/php/array/array_reduce.js"],"names":["module","exports","array_reduce","aInput","callback","lon","length","res","i","tmp","apply"],"mappings":";;AAAAA,OAAOC,OAAP,GAAiB,SAASC,YAAT,CAAuBC,MAAvB,EAA+BC,QAA/B,EAAyC;AAAE;AAC1D;AACA;AACA;AACA;AACA;;AAEA,MAAIC,MAAMF,OAAOG,MAAjB;AACA,MAAIC,MAAM,CAAV;AACA,MAAIC,IAAI,CAAR;AACA,MAAIC,MAAM,EAAV;;AAEA,OAAKD,IAAI,CAAT,EAAYA,IAAIH,GAAhB,EAAqBG,KAAK,CAA1B,EAA6B;AAC3BC,QAAI,CAAJ,IAASN,OAAOK,CAAP,CAAT;AACA,QAAIL,OAAQK,IAAI,CAAZ,CAAJ,EAAqB;AACnBC,UAAI,CAAJ,IAASN,OAAQK,IAAI,CAAZ,CAAT;AACD,KAFD,MAEO;AACLC,UAAI,CAAJ,IAAS,CAAT;AACD;AACDF,WAAOH,SAASM,KAAT,CAAe,IAAf,EAAqBD,GAArB,CAAP;AACAA,UAAM,EAAN;AACD;;AAED,SAAOF,GAAP;AACD,CAxBD","file":"array_reduce.js","sourcesContent":["module.exports = function array_reduce (aInput, callback) { // eslint-disable-line camelcase\n // discuss at: http://locutus.io/php/array_reduce/\n // original by: Alfonso Jimenez (http://www.alfonsojimenez.com)\n // note 1: Takes a function as an argument, not a function's name\n // example 1: array_reduce([1, 2, 3, 4, 5], function (v, w){v += w;return v;})\n // returns 1: 15\n\n var lon = aInput.length\n var res = 0\n var i = 0\n var tmp = []\n\n for (i = 0; i < lon; i += 2) {\n tmp[0] = aInput[i]\n if (aInput[(i + 1)]) {\n tmp[1] = aInput[(i + 1)]\n } else {\n tmp[1] = 0\n }\n res += callback.apply(null, tmp)\n tmp = []\n }\n\n return res\n}\n"]} \ No newline at end of file