summaryrefslogtreecommitdiff
path: root/node_modules/locutus/php/strings/strlen.js.map
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/locutus/php/strings/strlen.js.map')
-rw-r--r--node_modules/locutus/php/strings/strlen.js.map1
1 files changed, 1 insertions, 0 deletions
diff --git a/node_modules/locutus/php/strings/strlen.js.map b/node_modules/locutus/php/strings/strlen.js.map
new file mode 100644
index 0000000..edbe807
--- /dev/null
+++ b/node_modules/locutus/php/strings/strlen.js.map
@@ -0,0 +1 @@
+{"version":3,"sources":["../../../src/php/strings/strlen.js"],"names":["module","exports","strlen","string","str","iniVal","require","undefined","length","i","lgth","getWholeChar","code","charCodeAt","next","prev","Error","charAt"],"mappings":";;AAAAA,OAAOC,OAAP,GAAiB,SAASC,MAAT,CAAiBC,MAAjB,EAAyB;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,MAAIC,MAAMD,SAAS,EAAnB;;AAEA,MAAIE,SAAS,CAAC,OAAOC,OAAP,KAAmB,WAAnB,GAAiCA,QAAQ,iBAAR,EAA2B,mBAA3B,CAAjC,GAAmFC,SAApF,KAAkG,KAA/G;AACA,MAAIF,WAAW,KAAf,EAAsB;AACpB,WAAOD,IAAII,MAAX;AACD;;AAED,MAAIC,IAAI,CAAR;AACA,MAAIC,OAAO,CAAX;;AAEA,MAAIC,eAAe,SAAfA,YAAe,CAAUP,GAAV,EAAeK,CAAf,EAAkB;AACnC,QAAIG,OAAOR,IAAIS,UAAJ,CAAeJ,CAAf,CAAX;AACA,QAAIK,OAAO,EAAX;AACA,QAAIC,OAAO,EAAX;AACA,QAAIH,QAAQ,MAAR,IAAkBA,QAAQ,MAA9B,EAAsC;AACpC;AACA;AACA,UAAIR,IAAII,MAAJ,IAAeC,IAAI,CAAvB,EAA2B;AACzB,cAAM,IAAIO,KAAJ,CAAU,gDAAV,CAAN;AACD;AACDF,aAAOV,IAAIS,UAAJ,CAAeJ,IAAI,CAAnB,CAAP;AACA,UAAIK,OAAO,MAAP,IAAiBA,OAAO,MAA5B,EAAoC;AAClC,cAAM,IAAIE,KAAJ,CAAU,gDAAV,CAAN;AACD;AACD,aAAOZ,IAAIa,MAAJ,CAAWR,CAAX,IAAgBL,IAAIa,MAAJ,CAAWR,IAAI,CAAf,CAAvB;AACD,KAXD,MAWO,IAAIG,QAAQ,MAAR,IAAkBA,QAAQ,MAA9B,EAAsC;AAC3C;AACA,UAAIH,MAAM,CAAV,EAAa;AACX,cAAM,IAAIO,KAAJ,CAAU,gDAAV,CAAN;AACD;AACDD,aAAOX,IAAIS,UAAJ,CAAeJ,IAAI,CAAnB,CAAP;AACA,UAAIM,OAAO,MAAP,IAAiBA,OAAO,MAA5B,EAAoC;AAClC;AACA;AACA,cAAM,IAAIC,KAAJ,CAAU,gDAAV,CAAN;AACD;AACD;AACA;AACA,aAAO,KAAP;AACD;AACD,WAAOZ,IAAIa,MAAJ,CAAWR,CAAX,CAAP;AACD,GA/BD;;AAiCA,OAAKA,IAAI,CAAJ,EAAOC,OAAO,CAAnB,EAAsBD,IAAIL,IAAII,MAA9B,EAAsCC,GAAtC,EAA2C;AACzC,QAAKE,aAAaP,GAAb,EAAkBK,CAAlB,CAAD,KAA2B,KAA/B,EAAsC;AACpC;AACD;AACD;AACA;AACA;AACA;AACAC;AACD;;AAED,SAAOA,IAAP;AACD,CAxED","file":"strlen.js","sourcesContent":["module.exports = function strlen (string) {\n // discuss at: http://locutus.io/php/strlen/\n // original by: Kevin van Zonneveld (http://kvz.io)\n // improved by: Sakimori\n // improved by: Kevin van Zonneveld (http://kvz.io)\n // input by: Kirk Strobeck\n // bugfixed by: Onno Marsman (https://twitter.com/onnomarsman)\n // revised by: Brett Zamir (http://brett-zamir.me)\n // note 1: May look like overkill, but in order to be truly faithful to handling all Unicode\n // note 1: characters and to this function in PHP which does not count the number of bytes\n // note 1: but counts the number of characters, something like this is really necessary.\n // example 1: strlen('Kevin van Zonneveld')\n // returns 1: 19\n // example 2: ini_set('unicode.semantics', 'on')\n // example 2: strlen('A\\ud87e\\udc04Z')\n // returns 2: 3\n\n var str = string + ''\n\n var iniVal = (typeof require !== 'undefined' ? require('../info/ini_get')('unicode.semantics') : undefined) || 'off'\n if (iniVal === 'off') {\n return str.length\n }\n\n var i = 0\n var lgth = 0\n\n var getWholeChar = function (str, i) {\n var code = str.charCodeAt(i)\n var next = ''\n var prev = ''\n if (code >= 0xD800 && code <= 0xDBFF) {\n // High surrogate (could change last hex to 0xDB7F to\n // treat high private surrogates as single characters)\n if (str.length <= (i + 1)) {\n throw new Error('High surrogate without following low surrogate')\n }\n next = str.charCodeAt(i + 1)\n if (next < 0xDC00 || next > 0xDFFF) {\n throw new Error('High surrogate without following low surrogate')\n }\n return str.charAt(i) + str.charAt(i + 1)\n } else if (code >= 0xDC00 && code <= 0xDFFF) {\n // Low surrogate\n if (i === 0) {\n throw new Error('Low surrogate without preceding high surrogate')\n }\n prev = str.charCodeAt(i - 1)\n if (prev < 0xD800 || prev > 0xDBFF) {\n // (could change last hex to 0xDB7F to treat high private surrogates\n // as single characters)\n throw new Error('Low surrogate without preceding high surrogate')\n }\n // We can pass over low surrogates now as the second\n // component in a pair which we have already processed\n return false\n }\n return str.charAt(i)\n }\n\n for (i = 0, lgth = 0; i < str.length; i++) {\n if ((getWholeChar(str, i)) === false) {\n continue\n }\n // Adapt this line at the top of any loop, passing in the whole string and\n // the current iteration and returning a variable to represent the individual character;\n // purpose is to treat the first part of a surrogate pair as the whole character and then\n // ignore the second part\n lgth++\n }\n\n return lgth\n}\n"]} \ No newline at end of file