summaryrefslogtreecommitdiff
path: root/node_modules/locutus/golang/strings/Count.js.map
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/locutus/golang/strings/Count.js.map')
-rw-r--r--node_modules/locutus/golang/strings/Count.js.map1
1 files changed, 1 insertions, 0 deletions
diff --git a/node_modules/locutus/golang/strings/Count.js.map b/node_modules/locutus/golang/strings/Count.js.map
new file mode 100644
index 0000000..1e774ac
--- /dev/null
+++ b/node_modules/locutus/golang/strings/Count.js.map
@@ -0,0 +1 @@
+{"version":3,"sources":["../../../src/golang/strings/Count.js"],"names":["module","exports","Count","s","sep","pos","n","length","split","indexOf","substring"],"mappings":";;AAAAA,OAAOC,OAAP,GAAiB,SAASC,KAAT,CAAgBC,CAAhB,EAAmBC,GAAnB,EAAwB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,MAAIC,GAAJ;AACA,MAAIC,IAAI,CAAR;;AAEA,MAAKF,IAAIG,MAAJ,KAAe,CAApB,EAAwB;AACtB,WAAOJ,EAAEK,KAAF,CAAQJ,GAAR,EAAaG,MAAb,GAAsB,CAA7B;AACD,GAFD,MAEO,IAAIH,IAAIG,MAAJ,GAAaJ,EAAEI,MAAnB,EAA2B;AAChC,WAAO,CAAP;AACD,GAFM,MAEA,IAAKH,IAAIG,MAAJ,KAAeJ,EAAEI,MAAtB,EAA+B;AACpC,QAAIH,QAAQD,CAAZ,EAAe;AACb,aAAO,CAAP;AACD;AACD,WAAO,CAAP;AACD;AACD,SAAO,IAAP,EAAa;AACXE,UAAM,CAACF,IAAI,EAAL,EAASM,OAAT,CAAiBL,GAAjB,CAAN;AACA,QAAIC,QAAQ,CAAC,CAAb,EAAgB;AACd;AACD;AACDC,QAAIA,IAAK,CAAL,IAAW,CAAf;AACAH,QAAIA,EAAEO,SAAF,CAAaL,MAAMD,IAAIG,MAAV,IAAoB,CAAjC,CAAJ;AACD;AACD,SAAOD,CAAP;AACD,CA/BD","file":"Count.js","sourcesContent":["module.exports = function Count (s, sep) {\n // discuss at: http://locutus.io/php/printf/\n // original by: Kevin van Zonneveld (http://kvz.io)\n // input by: GopherJS (http://www.gopherjs.org/)\n // example 1: Count(\"cheese\", \"e\")\n // returns 1: 3\n // example 2: Count(\"five\", \"\") // before & after each rune\n // returns 2: 5\n\n var pos\n var n = 0\n\n if ((sep.length === 0)) {\n return s.split(sep).length + 1\n } else if (sep.length > s.length) {\n return 0\n } else if ((sep.length === s.length)) {\n if (sep === s) {\n return 1\n }\n return 0\n }\n while (true) {\n pos = (s + '').indexOf(sep)\n if (pos === -1) {\n break\n }\n n = n + (1) >> 0\n s = s.substring((pos + sep.length >> 0))\n }\n return n\n}\n"]} \ No newline at end of file