diff options
Diffstat (limited to 'node_modules/locutus/php/strings')
184 files changed, 5752 insertions, 0 deletions
diff --git a/node_modules/locutus/php/strings/addcslashes.js b/node_modules/locutus/php/strings/addcslashes.js new file mode 100644 index 0000000..1518078 --- /dev/null +++ b/node_modules/locutus/php/strings/addcslashes.js @@ -0,0 +1,176 @@ +'use strict'; + +module.exports = function addcslashes(str, charlist) { + // discuss at: http://locutus.io/php/addcslashes/ + // original by: Brett Zamir (http://brett-zamir.me) + // note 1: We show double backslashes in the return value example + // note 1: code below because a JavaScript string will not + // note 1: render them as backslashes otherwise + // example 1: addcslashes('foo[ ]', 'A..z'); // Escape all ASCII within capital A to lower z range, including square brackets + // returns 1: "\\f\\o\\o\\[ \\]" + // example 2: addcslashes("zoo['.']", 'z..A'); // Only escape z, period, and A here since not a lower-to-higher range + // returns 2: "\\zoo['\\.']" + // _example 3: addcslashes("@a\u0000\u0010\u00A9", "\0..\37!@\177..\377"); // Escape as octals those specified and less than 32 (0x20) or greater than 126 (0x7E), but not otherwise + // _returns 3: '\\@a\\000\\020\\302\\251' + // _example 4: addcslashes("\u0020\u007E", "\40..\175"); // Those between 32 (0x20 or 040) and 126 (0x7E or 0176) decimal value will be backslashed if specified (not octalized) + // _returns 4: '\\ ~' + // _example 5: addcslashes("\r\u0007\n", '\0..\37'); // Recognize C escape sequences if specified + // _returns 5: "\\r\\a\\n" + // _example 6: addcslashes("\r\u0007\n", '\0'); // Do not recognize C escape sequences if not specified + // _returns 6: "\r\u0007\n" + + var target = ''; + var chrs = []; + var i = 0; + var j = 0; + var c = ''; + var next = ''; + var rangeBegin = ''; + var rangeEnd = ''; + var chr = ''; + var begin = 0; + var end = 0; + var octalLength = 0; + var postOctalPos = 0; + var cca = 0; + var escHexGrp = []; + var encoded = ''; + var percentHex = /%([\dA-Fa-f]+)/g; + + var _pad = function _pad(n, c) { + if ((n = n + '').length < c) { + return new Array(++c - n.length).join('0') + n; + } + return n; + }; + + for (i = 0; i < charlist.length; i++) { + c = charlist.charAt(i); + next = charlist.charAt(i + 1); + if (c === '\\' && next && /\d/.test(next)) { + // Octal + rangeBegin = charlist.slice(i + 1).match(/^\d+/)[0]; + octalLength = rangeBegin.length; + postOctalPos = i + octalLength + 1; + if (charlist.charAt(postOctalPos) + charlist.charAt(postOctalPos + 1) === '..') { + // Octal begins range + begin = rangeBegin.charCodeAt(0); + if (/\\\d/.test(charlist.charAt(postOctalPos + 2) + charlist.charAt(postOctalPos + 3))) { + // Range ends with octal + rangeEnd = charlist.slice(postOctalPos + 3).match(/^\d+/)[0]; + // Skip range end backslash + i += 1; + } else if (charlist.charAt(postOctalPos + 2)) { + // Range ends with character + rangeEnd = charlist.charAt(postOctalPos + 2); + } else { + throw new Error('Range with no end point'); + } + end = rangeEnd.charCodeAt(0); + if (end > begin) { + // Treat as a range + for (j = begin; j <= end; j++) { + chrs.push(String.fromCharCode(j)); + } + } else { + // Supposed to treat period, begin and end as individual characters only, not a range + chrs.push('.', rangeBegin, rangeEnd); + } + // Skip dots and range end (already skipped range end backslash if present) + i += rangeEnd.length + 2; + } else { + // Octal is by itself + chr = String.fromCharCode(parseInt(rangeBegin, 8)); + chrs.push(chr); + } + // Skip range begin + i += octalLength; + } else if (next + charlist.charAt(i + 2) === '..') { + // Character begins range + rangeBegin = c; + begin = rangeBegin.charCodeAt(0); + if (/\\\d/.test(charlist.charAt(i + 3) + charlist.charAt(i + 4))) { + // Range ends with octal + rangeEnd = charlist.slice(i + 4).match(/^\d+/)[0]; + // Skip range end backslash + i += 1; + } else if (charlist.charAt(i + 3)) { + // Range ends with character + rangeEnd = charlist.charAt(i + 3); + } else { + throw new Error('Range with no end point'); + } + end = rangeEnd.charCodeAt(0); + if (end > begin) { + // Treat as a range + for (j = begin; j <= end; j++) { + chrs.push(String.fromCharCode(j)); + } + } else { + // Supposed to treat period, begin and end as individual characters only, not a range + chrs.push('.', rangeBegin, rangeEnd); + } + // Skip dots and range end (already skipped range end backslash if present) + i += rangeEnd.length + 2; + } else { + // Character is by itself + chrs.push(c); + } + } + + for (i = 0; i < str.length; i++) { + c = str.charAt(i); + if (chrs.indexOf(c) !== -1) { + target += '\\'; + cca = c.charCodeAt(0); + if (cca < 32 || cca > 126) { + // Needs special escaping + switch (c) { + case '\n': + target += 'n'; + break; + case '\t': + target += 't'; + break; + case '\r': + target += 'r'; + break; + case '\x07': + target += 'a'; + break; + case '\v': + target += 'v'; + break; + case '\b': + target += 'b'; + break; + case '\f': + target += 'f'; + break; + default: + // target += _pad(cca.toString(8), 3);break; // Sufficient for UTF-16 + encoded = encodeURIComponent(c); + + // 3-length-padded UTF-8 octets + if ((escHexGrp = percentHex.exec(encoded)) !== null) { + // already added a slash above: + target += _pad(parseInt(escHexGrp[1], 16).toString(8), 3); + } + while ((escHexGrp = percentHex.exec(encoded)) !== null) { + target += '\\' + _pad(parseInt(escHexGrp[1], 16).toString(8), 3); + } + break; + } + } else { + // Perform regular backslashed escaping + target += c; + } + } else { + // Just add the character unescaped + target += c; + } + } + + return target; +}; +//# sourceMappingURL=addcslashes.js.map
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/addcslashes.js.map b/node_modules/locutus/php/strings/addcslashes.js.map new file mode 100644 index 0000000..a750b88 --- /dev/null +++ b/node_modules/locutus/php/strings/addcslashes.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/php/strings/addcslashes.js"],"names":["module","exports","addcslashes","str","charlist","target","chrs","i","j","c","next","rangeBegin","rangeEnd","chr","begin","end","octalLength","postOctalPos","cca","escHexGrp","encoded","percentHex","_pad","n","length","Array","join","charAt","test","slice","match","charCodeAt","Error","push","String","fromCharCode","parseInt","indexOf","encodeURIComponent","exec","toString"],"mappings":";;AAAAA,OAAOC,OAAP,GAAiB,SAASC,WAAT,CAAsBC,GAAtB,EAA2BC,QAA3B,EAAqC;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,MAAIC,SAAS,EAAb;AACA,MA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CAAR;AACE,eAAK,IAAL;AACEJ,sBAAU,GAAV;AACA;AACF,eAAK,IAAL;AACEA,sBAAU,GAAV;AACA;AACF,eAAK,IAAL;AACEA,sBAAU,GAAV;AACA;AACF,eAAK,MAAL;AACEA,sBAAU,GAAV;AACA;AACF,eAAK,IAAL;AACEA,sBAAU,GAAV;AACA;AACF,eAAK,IAAL;AACEA,sBAAU,GAAV;AACA;AACF,eAAK,IAAL;AACEA,sBAAU,GAAV;AACA;AACF;AACE;AACAe,sBAAUkB,mBAAmB7B,CAAnB,CAAV;;AAEA;AACA,gBAAI,CAACU,YAAYE,WAAWkB,IAAX,CAAgBnB,OAAhB,CAAb,MAA2C,IAA/C,EAAqD;AACnD;AACAf,wBAAUiB,KAAKc,SAASjB,UAAU,CAAV,CAAT,EAAuB,EAAvB,EAA2BqB,QAA3B,CAAoC,CAApC,CAAL,EAA6C,CAA7C,CAAV;AACD;AACD,mBAAO,CAACrB,YAAYE,WAAWkB,IAAX,CAAgBnB,OAAhB,CAAb,MAA2C,IAAlD,EAAwD;AACtDf,wBAAU,OAAOiB,KAAKc,SAASjB,UAAU,CAAV,CAAT,EAAuB,EAAvB,EAA2BqB,QAA3B,CAAoC,CAApC,CAAL,EAA6C,CAA7C,CAAjB;AACD;AACD;AAlCJ;AAoCD,OAtCD,MAsCO;AACL;AACAnC,kBAAUI,CAAV;AACD;AACF,KA7CD,MA6CO;AACL;AACAJ,gBAAUI,CAAV;AACD;AACF;;AAED,SAAOJ,MAAP;AACD,CA5KD","file":"addcslashes.js","sourcesContent":["module.exports = function addcslashes (str, charlist) {\n // discuss at: http://locutus.io/php/addcslashes/\n // original by: Brett Zamir (http://brett-zamir.me)\n // note 1: We show double backslashes in the return value example\n // note 1: code below because a JavaScript string will not\n // note 1: render them as backslashes otherwise\n // example 1: addcslashes('foo[ ]', 'A..z'); // Escape all ASCII within capital A to lower z range, including square brackets\n // returns 1: \"\\\\f\\\\o\\\\o\\\\[ \\\\]\"\n // example 2: addcslashes(\"zoo['.']\", 'z..A'); // Only escape z, period, and A here since not a lower-to-higher range\n // returns 2: \"\\\\zoo['\\\\.']\"\n // _example 3: addcslashes(\"@a\\u0000\\u0010\\u00A9\", \"\\0..\\37!@\\177..\\377\"); // Escape as octals those specified and less than 32 (0x20) or greater than 126 (0x7E), but not otherwise\n // _returns 3: '\\\\@a\\\\000\\\\020\\\\302\\\\251'\n // _example 4: addcslashes(\"\\u0020\\u007E\", \"\\40..\\175\"); // Those between 32 (0x20 or 040) and 126 (0x7E or 0176) decimal value will be backslashed if specified (not octalized)\n // _returns 4: '\\\\ ~'\n // _example 5: addcslashes(\"\\r\\u0007\\n\", '\\0..\\37'); // Recognize C escape sequences if specified\n // _returns 5: \"\\\\r\\\\a\\\\n\"\n // _example 6: addcslashes(\"\\r\\u0007\\n\", '\\0'); // Do not recognize C escape sequences if not specified\n // _returns 6: \"\\r\\u0007\\n\"\n\n var target = ''\n var chrs = []\n var i = 0\n var j = 0\n var c = ''\n var next = ''\n var rangeBegin = ''\n var rangeEnd = ''\n var chr = ''\n var begin = 0\n var end = 0\n var octalLength = 0\n var postOctalPos = 0\n var cca = 0\n var escHexGrp = []\n var encoded = ''\n var percentHex = /%([\\dA-Fa-f]+)/g\n\n var _pad = function (n, c) {\n if ((n = n + '').length < c) {\n return new Array(++c - n.length).join('0') + n\n }\n return n\n }\n\n for (i = 0; i < charlist.length; i++) {\n c = charlist.charAt(i)\n next = charlist.charAt(i + 1)\n if (c === '\\\\' && next && (/\\d/).test(next)) {\n // Octal\n rangeBegin = charlist.slice(i + 1).match(/^\\d+/)[0]\n octalLength = rangeBegin.length\n postOctalPos = i + octalLength + 1\n if (charlist.charAt(postOctalPos) + charlist.charAt(postOctalPos + 1) === '..') {\n // Octal begins range\n begin = rangeBegin.charCodeAt(0)\n if ((/\\\\\\d/).test(charlist.charAt(postOctalPos + 2) + charlist.charAt(postOctalPos + 3))) {\n // Range ends with octal\n rangeEnd = charlist.slice(postOctalPos + 3).match(/^\\d+/)[0]\n // Skip range end backslash\n i += 1\n } else if (charlist.charAt(postOctalPos + 2)) {\n // Range ends with character\n rangeEnd = charlist.charAt(postOctalPos + 2)\n } else {\n throw new Error('Range with no end point')\n }\n end = rangeEnd.charCodeAt(0)\n if (end > begin) {\n // Treat as a range\n for (j = begin; j <= end; j++) {\n chrs.push(String.fromCharCode(j))\n }\n } else {\n // Supposed to treat period, begin and end as individual characters only, not a range\n chrs.push('.', rangeBegin, rangeEnd)\n }\n // Skip dots and range end (already skipped range end backslash if present)\n i += rangeEnd.length + 2\n } else {\n // Octal is by itself\n chr = String.fromCharCode(parseInt(rangeBegin, 8))\n chrs.push(chr)\n }\n // Skip range begin\n i += octalLength\n } else if (next + charlist.charAt(i + 2) === '..') {\n // Character begins range\n rangeBegin = c\n begin = rangeBegin.charCodeAt(0)\n if ((/\\\\\\d/).test(charlist.charAt(i + 3) + charlist.charAt(i + 4))) {\n // Range ends with octal\n rangeEnd = charlist.slice(i + 4).match(/^\\d+/)[0]\n // Skip range end backslash\n i += 1\n } else if (charlist.charAt(i + 3)) {\n // Range ends with character\n rangeEnd = charlist.charAt(i + 3)\n } else {\n throw new Error('Range with no end point')\n }\n end = rangeEnd.charCodeAt(0)\n if (end > begin) {\n // Treat as a range\n for (j = begin; j <= end; j++) {\n chrs.push(String.fromCharCode(j))\n }\n } else {\n // Supposed to treat period, begin and end as individual characters only, not a range\n chrs.push('.', rangeBegin, rangeEnd)\n }\n // Skip dots and range end (already skipped range end backslash if present)\n i += rangeEnd.length + 2\n } else {\n // Character is by itself\n chrs.push(c)\n }\n }\n\n for (i = 0; i < str.length; i++) {\n c = str.charAt(i)\n if (chrs.indexOf(c) !== -1) {\n target += '\\\\'\n cca = c.charCodeAt(0)\n if (cca < 32 || cca > 126) {\n // Needs special escaping\n switch (c) {\n case '\\n':\n target += 'n'\n break\n case '\\t':\n target += 't'\n break\n case '\\u000D':\n target += 'r'\n break\n case '\\u0007':\n target += 'a'\n break\n case '\\v':\n target += 'v'\n break\n case '\\b':\n target += 'b'\n break\n case '\\f':\n target += 'f'\n break\n default:\n // target += _pad(cca.toString(8), 3);break; // Sufficient for UTF-16\n encoded = encodeURIComponent(c)\n\n // 3-length-padded UTF-8 octets\n if ((escHexGrp = percentHex.exec(encoded)) !== null) {\n // already added a slash above:\n target += _pad(parseInt(escHexGrp[1], 16).toString(8), 3)\n }\n while ((escHexGrp = percentHex.exec(encoded)) !== null) {\n target += '\\\\' + _pad(parseInt(escHexGrp[1], 16).toString(8), 3)\n }\n break\n }\n } else {\n // Perform regular backslashed escaping\n target += c\n }\n } else {\n // Just add the character unescaped\n target += c\n }\n }\n\n return target\n}\n"]}
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/addslashes.js b/node_modules/locutus/php/strings/addslashes.js new file mode 100644 index 0000000..b7c52ea --- /dev/null +++ b/node_modules/locutus/php/strings/addslashes.js @@ -0,0 +1,18 @@ +'use strict'; + +module.exports = function addslashes(str) { + // discuss at: http://locutus.io/php/addslashes/ + // original by: Kevin van Zonneveld (http://kvz.io) + // improved by: Ates Goral (http://magnetiq.com) + // improved by: marrtins + // improved by: Nate + // improved by: Onno Marsman (https://twitter.com/onnomarsman) + // improved by: Brett Zamir (http://brett-zamir.me) + // improved by: Oskar Larsson Högfeldt (http://oskar-lh.name/) + // input by: Denny Wardhana + // example 1: addslashes("kevin's birthday") + // returns 1: "kevin\\'s birthday" + + return (str + '').replace(/[\\"']/g, '\\$&').replace(/\u0000/g, '\\0'); +}; +//# sourceMappingURL=addslashes.js.map
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/addslashes.js.map b/node_modules/locutus/php/strings/addslashes.js.map new file mode 100644 index 0000000..a3616b3 --- /dev/null +++ b/node_modules/locutus/php/strings/addslashes.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/php/strings/addslashes.js"],"names":["module","exports","addslashes","str","replace"],"mappings":";;AAAAA,OAAOC,OAAP,GAAiB,SAASC,UAAT,CAAqBC,GAArB,EAA0B;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAAO,CAACA,MAAM,EAAP,EACJC,OADI,CACI,SADJ,EACe,MADf,EAEJA,OAFI,CAEI,SAFJ,EAEe,KAFf,CAAP;AAGD,CAhBD","file":"addslashes.js","sourcesContent":["module.exports = function addslashes (str) {\n // discuss at: http://locutus.io/php/addslashes/\n // original by: Kevin van Zonneveld (http://kvz.io)\n // improved by: Ates Goral (http://magnetiq.com)\n // improved by: marrtins\n // improved by: Nate\n // improved by: Onno Marsman (https://twitter.com/onnomarsman)\n // improved by: Brett Zamir (http://brett-zamir.me)\n // improved by: Oskar Larsson Högfeldt (http://oskar-lh.name/)\n // input by: Denny Wardhana\n // example 1: addslashes(\"kevin's birthday\")\n // returns 1: \"kevin\\\\'s birthday\"\n\n return (str + '')\n .replace(/[\\\\\"']/g, '\\\\$&')\n .replace(/\\u0000/g, '\\\\0')\n}\n"]}
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/bin2hex.js b/node_modules/locutus/php/strings/bin2hex.js new file mode 100644 index 0000000..344c03d --- /dev/null +++ b/node_modules/locutus/php/strings/bin2hex.js @@ -0,0 +1,28 @@ +'use strict'; + +module.exports = function bin2hex(s) { + // discuss at: http://locutus.io/php/bin2hex/ + // original by: Kevin van Zonneveld (http://kvz.io) + // bugfixed by: Onno Marsman (https://twitter.com/onnomarsman) + // bugfixed by: Linuxworld + // improved by: ntoniazzi (http://locutus.io/php/bin2hex:361#comment_177616) + // example 1: bin2hex('Kev') + // returns 1: '4b6576' + // example 2: bin2hex(String.fromCharCode(0x00)) + // returns 2: '00' + + var i; + var l; + var o = ''; + var n; + + s += ''; + + for (i = 0, l = s.length; i < l; i++) { + n = s.charCodeAt(i).toString(16); + o += n.length < 2 ? '0' + n : n; + } + + return o; +}; +//# sourceMappingURL=bin2hex.js.map
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/bin2hex.js.map b/node_modules/locutus/php/strings/bin2hex.js.map new file mode 100644 index 0000000..7bac440 --- /dev/null +++ b/node_modules/locutus/php/strings/bin2hex.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/php/strings/bin2hex.js"],"names":["module","exports","bin2hex","s","i","l","o","n","length","charCodeAt","toString"],"mappings":";;AAAAA,OAAOC,OAAP,GAAiB,SAASC,OAAT,CAAkBC,CAAlB,EAAqB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,MAAIC,CAAJ;AACA,MAAIC,CAAJ;AACA,MAAIC,IAAI,EAAR;AACA,MAAIC,CAAJ;;AAEAJ,OAAK,EAAL;;AAEA,OAAKC,IAAI,CAAJ,EAAOC,IAAIF,EAAEK,MAAlB,EAA0BJ,IAAIC,CAA9B,EAAiCD,GAAjC,EAAsC;AACpCG,QAAIJ,EAAEM,UAAF,CAAaL,CAAb,EACDM,QADC,CACQ,EADR,CAAJ;AAEAJ,SAAKC,EAAEC,MAAF,GAAW,CAAX,GAAe,MAAMD,CAArB,GAAyBA,CAA9B;AACD;;AAED,SAAOD,CAAP;AACD,CAzBD","file":"bin2hex.js","sourcesContent":["module.exports = function bin2hex (s) {\n // discuss at: http://locutus.io/php/bin2hex/\n // original by: Kevin van Zonneveld (http://kvz.io)\n // bugfixed by: Onno Marsman (https://twitter.com/onnomarsman)\n // bugfixed by: Linuxworld\n // improved by: ntoniazzi (http://locutus.io/php/bin2hex:361#comment_177616)\n // example 1: bin2hex('Kev')\n // returns 1: '4b6576'\n // example 2: bin2hex(String.fromCharCode(0x00))\n // returns 2: '00'\n\n var i\n var l\n var o = ''\n var n\n\n s += ''\n\n for (i = 0, l = s.length; i < l; i++) {\n n = s.charCodeAt(i)\n .toString(16)\n o += n.length < 2 ? '0' + n : n\n }\n\n return o\n}\n"]}
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/chop.js b/node_modules/locutus/php/strings/chop.js new file mode 100644 index 0000000..3629945 --- /dev/null +++ b/node_modules/locutus/php/strings/chop.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports = function chop(str, charlist) { + // discuss at: http://locutus.io/php/chop/ + // original by: Paulo Freitas + // example 1: chop(' Kevin van Zonneveld ') + // returns 1: ' Kevin van Zonneveld' + + var rtrim = require('../strings/rtrim'); + return rtrim(str, charlist); +}; +//# sourceMappingURL=chop.js.map
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/chop.js.map b/node_modules/locutus/php/strings/chop.js.map new file mode 100644 index 0000000..6164674 --- /dev/null +++ b/node_modules/locutus/php/strings/chop.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/php/strings/chop.js"],"names":["module","exports","chop","str","charlist","rtrim","require"],"mappings":";;AAAAA,OAAOC,OAAP,GAAiB,SAASC,IAAT,CAAeC,GAAf,EAAoBC,QAApB,EAA8B;AAC7C;AACA;AACA;AACA;;AAEA,MAAIC,QAAQC,QAAQ,kBAAR,CAAZ;AACA,SAAOD,MAAMF,GAAN,EAAWC,QAAX,CAAP;AACD,CARD","file":"chop.js","sourcesContent":["module.exports = function chop (str, charlist) {\n // discuss at: http://locutus.io/php/chop/\n // original by: Paulo Freitas\n // example 1: chop(' Kevin van Zonneveld ')\n // returns 1: ' Kevin van Zonneveld'\n\n var rtrim = require('../strings/rtrim')\n return rtrim(str, charlist)\n}\n"]}
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/chr.js b/node_modules/locutus/php/strings/chr.js new file mode 100644 index 0000000..8a6f52d --- /dev/null +++ b/node_modules/locutus/php/strings/chr.js @@ -0,0 +1,22 @@ +"use strict"; + +module.exports = function chr(codePt) { + // discuss at: http://locutus.io/php/chr/ + // original by: Kevin van Zonneveld (http://kvz.io) + // improved by: Brett Zamir (http://brett-zamir.me) + // example 1: chr(75) === 'K' + // example 1: chr(65536) === '\uD800\uDC00' + // returns 1: true + // returns 1: true + + if (codePt > 0xFFFF) { + // Create a four-byte string (length 2) since this code point is high + // enough for the UTF-16 encoding (JavaScript internal use), to + // require representation with two surrogates (reserved non-characters + // used for building other characters; the first is "high" and the next "low") + codePt -= 0x10000; + return String.fromCharCode(0xD800 + (codePt >> 10), 0xDC00 + (codePt & 0x3FF)); + } + return String.fromCharCode(codePt); +}; +//# sourceMappingURL=chr.js.map
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/chr.js.map b/node_modules/locutus/php/strings/chr.js.map new file mode 100644 index 0000000..4c7e9f7 --- /dev/null +++ b/node_modules/locutus/php/strings/chr.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/php/strings/chr.js"],"names":["module","exports","chr","codePt","String","fromCharCode"],"mappings":";;AAAAA,OAAOC,OAAP,GAAiB,SAASC,GAAT,CAAcC,MAAd,EAAsB;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,MAAIA,SAAS,MAAb,EAAqB;AAAE;AACrB;AACA;AACA;AACAA,cAAU,OAAV;AACA,WAAOC,OAAOC,YAAP,CAAoB,UAAUF,UAAU,EAApB,CAApB,EAA6C,UAAUA,SAAS,KAAnB,CAA7C,CAAP;AACD;AACD,SAAOC,OAAOC,YAAP,CAAoBF,MAApB,CAAP;AACD,CAjBD","file":"chr.js","sourcesContent":["module.exports = function chr (codePt) {\n // discuss at: http://locutus.io/php/chr/\n // original by: Kevin van Zonneveld (http://kvz.io)\n // improved by: Brett Zamir (http://brett-zamir.me)\n // example 1: chr(75) === 'K'\n // example 1: chr(65536) === '\\uD800\\uDC00'\n // returns 1: true\n // returns 1: true\n\n if (codePt > 0xFFFF) { // Create a four-byte string (length 2) since this code point is high\n // enough for the UTF-16 encoding (JavaScript internal use), to\n // require representation with two surrogates (reserved non-characters\n // used for building other characters; the first is \"high\" and the next \"low\")\n codePt -= 0x10000\n return String.fromCharCode(0xD800 + (codePt >> 10), 0xDC00 + (codePt & 0x3FF))\n }\n return String.fromCharCode(codePt)\n}\n"]}
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/chunk_split.js b/node_modules/locutus/php/strings/chunk_split.js new file mode 100644 index 0000000..24f6e00 --- /dev/null +++ b/node_modules/locutus/php/strings/chunk_split.js @@ -0,0 +1,24 @@ +'use strict'; + +module.exports = function chunk_split(body, chunklen, end) { + // eslint-disable-line camelcase + // discuss at: http://locutus.io/php/chunk_split/ + // original by: Paulo Freitas + // input by: Brett Zamir (http://brett-zamir.me) + // bugfixed by: Kevin van Zonneveld (http://kvz.io) + // improved by: Theriault (https://github.com/Theriault) + // example 1: chunk_split('Hello world!', 1, '*') + // returns 1: 'H*e*l*l*o* *w*o*r*l*d*!*' + // example 2: chunk_split('Hello world!', 10, '*') + // returns 2: 'Hello worl*d!*' + + chunklen = parseInt(chunklen, 10) || 76; + end = end || '\r\n'; + + if (chunklen < 1) { + return false; + } + + return body.match(new RegExp('.{0,' + chunklen + '}', 'g')).join(end); +}; +//# sourceMappingURL=chunk_split.js.map
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/chunk_split.js.map b/node_modules/locutus/php/strings/chunk_split.js.map new file mode 100644 index 0000000..401e1a6 --- /dev/null +++ b/node_modules/locutus/php/strings/chunk_split.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/php/strings/chunk_split.js"],"names":["module","exports","chunk_split","body","chunklen","end","parseInt","match","RegExp","join"],"mappings":";;AAAAA,OAAOC,OAAP,GAAiB,SAASC,WAAT,CAAsBC,IAAtB,EAA4BC,QAA5B,EAAsCC,GAAtC,EAA2C;AAAE;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEAD,aAAWE,SAASF,QAAT,EAAmB,EAAnB,KAA0B,EAArC;AACAC,QAAMA,OAAO,MAAb;;AAEA,MAAID,WAAW,CAAf,EAAkB;AAChB,WAAO,KAAP;AACD;;AAED,SAAOD,KAAKI,KAAL,CAAW,IAAIC,MAAJ,CAAW,SAASJ,QAAT,GAAoB,GAA/B,EAAoC,GAApC,CAAX,EACJK,IADI,CACCJ,GADD,CAAP;AAED,CApBD","file":"chunk_split.js","sourcesContent":["module.exports = function chunk_split (body, chunklen, end) { // eslint-disable-line camelcase\n // discuss at: http://locutus.io/php/chunk_split/\n // original by: Paulo Freitas\n // input by: Brett Zamir (http://brett-zamir.me)\n // bugfixed by: Kevin van Zonneveld (http://kvz.io)\n // improved by: Theriault (https://github.com/Theriault)\n // example 1: chunk_split('Hello world!', 1, '*')\n // returns 1: 'H*e*l*l*o* *w*o*r*l*d*!*'\n // example 2: chunk_split('Hello world!', 10, '*')\n // returns 2: 'Hello worl*d!*'\n\n chunklen = parseInt(chunklen, 10) || 76\n end = end || '\\r\\n'\n\n if (chunklen < 1) {\n return false\n }\n\n return body.match(new RegExp('.{0,' + chunklen + '}', 'g'))\n .join(end)\n}\n"]}
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/convert_cyr_string.js b/node_modules/locutus/php/strings/convert_cyr_string.js new file mode 100644 index 0000000..9184be6 --- /dev/null +++ b/node_modules/locutus/php/strings/convert_cyr_string.js @@ -0,0 +1,84 @@ +'use strict'; + +module.exports = function convert_cyr_string(str, from, to) { + // eslint-disable-line camelcase + // discuss at: http://locutus.io/php/convert_cyr_string/ + // original by: Brett Zamir (http://brett-zamir.me) + // note 1: Assumes and converts to Unicode strings with character + // note 1: code equivalents of the same numbers as in the from or + // note 1: target character set; Note that neither the input or output + // note 1: should be treated as actual Unicode, since the PHP function + // note 1: this is original by does not either + // note 1: One could easily represent (or convert the results) of a + // note 1: string form as arrays of code points instead but since JavaScript + // note 1: currently has no clear binary data type, we chose to use strings + // note 1: as in PHP + // example 1: convert_cyr_string(String.fromCharCode(214), 'k', 'w').charCodeAt(0) === 230; // Char. 214 of KOI8-R gives equivalent number value 230 in win1251 + // returns 1: true + + var _cyrWin1251 = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 154, 174, 190, 46, 159, 189, 46, 46, 179, 191, 180, 157, 46, 46, 156, 183, 46, 46, 182, 166, 173, 46, 46, 158, 163, 152, 164, 155, 46, 46, 46, 167, 225, 226, 247, 231, 228, 229, 246, 250, 233, 234, 235, 236, 237, 238, 239, 240, 242, 243, 244, 245, 230, 232, 227, 254, 251, 253, 255, 249, 248, 252, 224, 241, 193, 194, 215, 199, 196, 197, 214, 218, 201, 202, 203, 204, 205, 206, 207, 208, 210, 211, 212, 213, 198, 200, 195, 222, 219, 221, 223, 217, 216, 220, 192, 209, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 184, 186, 32, 179, 191, 32, 32, 32, 32, 32, 180, 162, 32, 32, 32, 32, 168, 170, 32, 178, 175, 32, 32, 32, 32, 32, 165, 161, 169, 254, 224, 225, 246, 228, 229, 244, 227, 245, 232, 233, 234, 235, 236, 237, 238, 239, 255, 240, 241, 242, 243, 230, 226, 252, 251, 231, 248, 253, 249, 247, 250, 222, 192, 193, 214, 196, 197, 212, 195, 213, 200, 201, 202, 203, 204, 205, 206, 207, 223, 208, 209, 210, 211, 198, 194, 220, 219, 199, 216, 221, 217, 215, 218]; + var _cyrCp866 = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 225, 226, 247, 231, 228, 229, 246, 250, 233, 234, 235, 236, 237, 238, 239, 240, 242, 243, 244, 245, 230, 232, 227, 254, 251, 253, 255, 249, 248, 252, 224, 241, 193, 194, 215, 199, 196, 197, 214, 218, 201, 202, 203, 204, 205, 206, 207, 208, 35, 35, 35, 124, 124, 124, 124, 43, 43, 124, 124, 43, 43, 43, 43, 43, 43, 45, 45, 124, 45, 43, 124, 124, 43, 43, 45, 45, 124, 45, 43, 45, 45, 45, 45, 43, 43, 43, 43, 43, 43, 43, 43, 35, 35, 124, 124, 35, 210, 211, 212, 213, 198, 200, 195, 222, 219, 221, 223, 217, 216, 220, 192, 209, 179, 163, 180, 164, 183, 167, 190, 174, 32, 149, 158, 32, 152, 159, 148, 154, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 205, 186, 213, 241, 243, 201, 32, 245, 187, 212, 211, 200, 190, 32, 247, 198, 199, 204, 181, 240, 242, 185, 32, 244, 203, 207, 208, 202, 216, 32, 246, 32, 238, 160, 161, 230, 164, 165, 228, 163, 229, 168, 169, 170, 171, 172, 173, 174, 175, 239, 224, 225, 226, 227, 166, 162, 236, 235, 167, 232, 237, 233, 231, 234, 158, 128, 129, 150, 132, 133, 148, 131, 149, 136, 137, 138, 139, 140, 141, 142, 143, 159, 144, 145, 146, 147, 134, 130, 156, 155, 135, 152, 157, 153, 151, 154]; + var _cyrIso88595 = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 179, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 225, 226, 247, 231, 228, 229, 246, 250, 233, 234, 235, 236, 237, 238, 239, 240, 242, 243, 244, 245, 230, 232, 227, 254, 251, 253, 255, 249, 248, 252, 224, 241, 193, 194, 215, 199, 196, 197, 214, 218, 201, 202, 203, 204, 205, 206, 207, 208, 210, 211, 212, 213, 198, 200, 195, 222, 219, 221, 223, 217, 216, 220, 192, 209, 32, 163, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 241, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 161, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 238, 208, 209, 230, 212, 213, 228, 211, 229, 216, 217, 218, 219, 220, 221, 222, 223, 239, 224, 225, 226, 227, 214, 210, 236, 235, 215, 232, 237, 233, 231, 234, 206, 176, 177, 198, 180, 181, 196, 179, 197, 184, 185, 186, 187, 188, 189, 190, 191, 207, 192, 193, 194, 195, 182, 178, 204, 203, 183, 200, 205, 201, 199, 202]; + var _cyrMac = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 225, 226, 247, 231, 228, 229, 246, 250, 233, 234, 235, 236, 237, 238, 239, 240, 242, 243, 244, 245, 230, 232, 227, 254, 251, 253, 255, 249, 248, 252, 224, 241, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 179, 163, 209, 193, 194, 215, 199, 196, 197, 214, 218, 201, 202, 203, 204, 205, 206, 207, 208, 210, 211, 212, 213, 198, 200, 195, 222, 219, 221, 223, 217, 216, 220, 192, 255, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 160, 161, 162, 222, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 221, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 254, 224, 225, 246, 228, 229, 244, 227, 245, 232, 233, 234, 235, 236, 237, 238, 239, 223, 240, 241, 242, 243, 230, 226, 252, 251, 231, 248, 253, 249, 247, 250, 158, 128, 129, 150, 132, 133, 148, 131, 149, 136, 137, 138, 139, 140, 141, 142, 143, 159, 144, 145, 146, 147, 134, 130, 156, 155, 135, 152, 157, 153, 151, 154]; + + var fromTable = null; + var toTable = null; + var tmp; + var i = 0; + var retStr = ''; + + switch (from.toUpperCase()) { + case 'W': + fromTable = _cyrWin1251; + break; + case 'A': + case 'D': + fromTable = _cyrCp866; + break; + case 'I': + fromTable = _cyrIso88595; + break; + case 'M': + fromTable = _cyrMac; + break; + case 'K': + break; + default: + // Can we throw a warning instead? That would be more in line with PHP + throw new Error('Unknown source charset: ' + fromTable); + } + + switch (to.toUpperCase()) { + case 'W': + toTable = _cyrWin1251; + break; + case 'A': + case 'D': + toTable = _cyrCp866; + break; + case 'I': + toTable = _cyrIso88595; + break; + case 'M': + toTable = _cyrMac; + break; + case 'K': + break; + default: + // Can we throw a warning instead? That would be more in line with PHP + throw new Error('Unknown destination charset: ' + toTable); + } + + if (!str) { + return str; + } + + for (i = 0; i < str.length; i++) { + tmp = fromTable === null ? str.charAt(i) : String.fromCharCode(fromTable[str.charAt(i).charCodeAt(0)]); + + retStr += toTable === null ? tmp : String.fromCharCode(toTable[tmp.charCodeAt(0) + 256]); + } + + return retStr; +}; +//# sourceMappingURL=convert_cyr_string.js.map
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/convert_cyr_string.js.map b/node_modules/locutus/php/strings/convert_cyr_string.js.map new file mode 100644 index 0000000..58d8bec --- /dev/null +++ b/node_modules/locutus/php/strings/convert_cyr_string.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/php/strings/convert_cyr_string.js"],"names":["module","exports","convert_cyr_string","str","from","to","_cyrWin1251","_cyrCp866","_cyrIso88595","_cyrMac","fromTable","toTable","tmp","i","retStr","toUpperCase","Error","length","charAt","String","fromCharCode","charCodeAt"],"mappings":";;AAAAA,OAAOC,OAAP,GAAiB,SAASC,kBAAT,CAA6BC,GAA7B,EAAkCC,IAAlC,EAAwCC,EAAxC,EAA4C;AAAE;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,MAAIC,cAAc,CAChB,CADgB,EAEhB,CAFgB,EAGhB,CAHgB,EAIhB,CAJgB,EAKhB,CALgB,EAMhB,CANgB,EAOhB,CAPgB,EAQhB,CARgB,EAShB,CATgB,EAUhB,CAVgB,EAWhB,EAXgB,EAYhB,EAZgB,EAahB,EAbgB,EAchB,EAdgB,EAehB,EAfgB,EAgB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AGD;;AAED,SAAOP,MAAP;AACD,CA1lED","file":"convert_cyr_string.js","sourcesContent":["module.exports = function convert_cyr_string (str, from, to) { // eslint-disable-line camelcase\n // discuss at: http://locutus.io/php/convert_cyr_string/\n // original by: Brett Zamir (http://brett-zamir.me)\n // note 1: Assumes and converts to Unicode strings with character\n // note 1: code equivalents of the same numbers as in the from or\n // note 1: target character set; Note that neither the input or output\n // note 1: should be treated as actual Unicode, since the PHP function\n // note 1: this is original by does not either\n // note 1: One could easily represent (or convert the results) of a\n // note 1: string form as arrays of code points instead but since JavaScript\n // note 1: currently has no clear binary data type, we chose to use strings\n // note 1: as in PHP\n // example 1: convert_cyr_string(String.fromCharCode(214), 'k', 'w').charCodeAt(0) === 230; // Char. 214 of KOI8-R gives equivalent number value 230 in win1251\n // returns 1: true\n\n var _cyrWin1251 = [\n 0,\n 1,\n 2,\n 3,\n 4,\n 5,\n 6,\n 7,\n 8,\n 9,\n 10,\n 11,\n 12,\n 13,\n 14,\n 15,\n 16,\n 17,\n 18,\n 19,\n 20,\n 21,\n 22,\n 23,\n 24,\n 25,\n 26,\n 27,\n 28,\n 29,\n 30,\n 31,\n 32,\n 33,\n 34,\n 35,\n 36,\n 37,\n 38,\n 39,\n 40,\n 41,\n 42,\n 43,\n 44,\n 45,\n 46,\n 47,\n 48,\n 49,\n 50,\n 51,\n 52,\n 53,\n 54,\n 55,\n 56,\n 57,\n 58,\n 59,\n 60,\n 61,\n 62,\n 63,\n 64,\n 65,\n 66,\n 67,\n 68,\n 69,\n 70,\n 71,\n 72,\n 73,\n 74,\n 75,\n 76,\n 77,\n 78,\n 79,\n 80,\n 81,\n 82,\n 83,\n 84,\n 85,\n 86,\n 87,\n 88,\n 89,\n 90,\n 91,\n 92,\n 93,\n 94,\n 95,\n 96,\n 97,\n 98,\n 99,\n 100,\n 101,\n 102,\n 103,\n 104,\n 105,\n 106,\n 107,\n 108,\n 109,\n 110,\n 111,\n 112,\n 113,\n 114,\n 115,\n 116,\n 117,\n 118,\n 119,\n 120,\n 121,\n 122,\n 123,\n 124,\n 125,\n 126,\n 127,\n 46,\n 46,\n 46,\n 46,\n 46,\n 46,\n 46,\n 46,\n 46,\n 46,\n 46,\n 46,\n 46,\n 46,\n 46,\n 46,\n 46,\n 46,\n 46,\n 46,\n 46,\n 46,\n 46,\n 46,\n 46,\n 46,\n 46,\n 46,\n 46,\n 46,\n 46,\n 46,\n 154,\n 174,\n 190,\n 46,\n 159,\n 189,\n 46,\n 46,\n 179,\n 191,\n 180,\n 157,\n 46,\n 46,\n 156,\n 183,\n 46,\n 46,\n 182,\n 166,\n 173,\n 46,\n 46,\n 158,\n 163,\n 152,\n 164,\n 155,\n 46,\n 46,\n 46,\n 167,\n 225,\n 226,\n 247,\n 231,\n 228,\n 229,\n 246,\n 250,\n 233,\n 234,\n 235,\n 236,\n 237,\n 238,\n 239,\n 240,\n 242,\n 243,\n 244,\n 245,\n 230,\n 232,\n 227,\n 254,\n 251,\n 253,\n 255,\n 249,\n 248,\n 252,\n 224,\n 241,\n 193,\n 194,\n 215,\n 199,\n 196,\n 197,\n 214,\n 218,\n 201,\n 202,\n 203,\n 204,\n 205,\n 206,\n 207,\n 208,\n 210,\n 211,\n 212,\n 213,\n 198,\n 200,\n 195,\n 222,\n 219,\n 221,\n 223,\n 217,\n 216,\n 220,\n 192,\n 209,\n 0,\n 1,\n 2,\n 3,\n 4,\n 5,\n 6,\n 7,\n 8,\n 9,\n 10,\n 11,\n 12,\n 13,\n 14,\n 15,\n 16,\n 17,\n 18,\n 19,\n 20,\n 21,\n 22,\n 23,\n 24,\n 25,\n 26,\n 27,\n 28,\n 29,\n 30,\n 31,\n 32,\n 33,\n 34,\n 35,\n 36,\n 37,\n 38,\n 39,\n 40,\n 41,\n 42,\n 43,\n 44,\n 45,\n 46,\n 47,\n 48,\n 49,\n 50,\n 51,\n 52,\n 53,\n 54,\n 55,\n 56,\n 57,\n 58,\n 59,\n 60,\n 61,\n 62,\n 63,\n 64,\n 65,\n 66,\n 67,\n 68,\n 69,\n 70,\n 71,\n 72,\n 73,\n 74,\n 75,\n 76,\n 77,\n 78,\n 79,\n 80,\n 81,\n 82,\n 83,\n 84,\n 85,\n 86,\n 87,\n 88,\n 89,\n 90,\n 91,\n 92,\n 93,\n 94,\n 95,\n 96,\n 97,\n 98,\n 99,\n 100,\n 101,\n 102,\n 103,\n 104,\n 105,\n 106,\n 107,\n 108,\n 109,\n 110,\n 111,\n 112,\n 113,\n 114,\n 115,\n 116,\n 117,\n 118,\n 119,\n 120,\n 121,\n 122,\n 123,\n 124,\n 125,\n 126,\n 127,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 184,\n 186,\n 32,\n 179,\n 191,\n 32,\n 32,\n 32,\n 32,\n 32,\n 180,\n 162,\n 32,\n 32,\n 32,\n 32,\n 168,\n 170,\n 32,\n 178,\n 175,\n 32,\n 32,\n 32,\n 32,\n 32,\n 165,\n 161,\n 169,\n 254,\n 224,\n 225,\n 246,\n 228,\n 229,\n 244,\n 227,\n 245,\n 232,\n 233,\n 234,\n 235,\n 236,\n 237,\n 238,\n 239,\n 255,\n 240,\n 241,\n 242,\n 243,\n 230,\n 226,\n 252,\n 251,\n 231,\n 248,\n 253,\n 249,\n 247,\n 250,\n 222,\n 192,\n 193,\n 214,\n 196,\n 197,\n 212,\n 195,\n 213,\n 200,\n 201,\n 202,\n 203,\n 204,\n 205,\n 206,\n 207,\n 223,\n 208,\n 209,\n 210,\n 211,\n 198,\n 194,\n 220,\n 219,\n 199,\n 216,\n 221,\n 217,\n 215,\n 218\n ]\n var _cyrCp866 = [\n 0,\n 1,\n 2,\n 3,\n 4,\n 5,\n 6,\n 7,\n 8,\n 9,\n 10,\n 11,\n 12,\n 13,\n 14,\n 15,\n 16,\n 17,\n 18,\n 19,\n 20,\n 21,\n 22,\n 23,\n 24,\n 25,\n 26,\n 27,\n 28,\n 29,\n 30,\n 31,\n 32,\n 33,\n 34,\n 35,\n 36,\n 37,\n 38,\n 39,\n 40,\n 41,\n 42,\n 43,\n 44,\n 45,\n 46,\n 47,\n 48,\n 49,\n 50,\n 51,\n 52,\n 53,\n 54,\n 55,\n 56,\n 57,\n 58,\n 59,\n 60,\n 61,\n 62,\n 63,\n 64,\n 65,\n 66,\n 67,\n 68,\n 69,\n 70,\n 71,\n 72,\n 73,\n 74,\n 75,\n 76,\n 77,\n 78,\n 79,\n 80,\n 81,\n 82,\n 83,\n 84,\n 85,\n 86,\n 87,\n 88,\n 89,\n 90,\n 91,\n 92,\n 93,\n 94,\n 95,\n 96,\n 97,\n 98,\n 99,\n 100,\n 101,\n 102,\n 103,\n 104,\n 105,\n 106,\n 107,\n 108,\n 109,\n 110,\n 111,\n 112,\n 113,\n 114,\n 115,\n 116,\n 117,\n 118,\n 119,\n 120,\n 121,\n 122,\n 123,\n 124,\n 125,\n 126,\n 127,\n 225,\n 226,\n 247,\n 231,\n 228,\n 229,\n 246,\n 250,\n 233,\n 234,\n 235,\n 236,\n 237,\n 238,\n 239,\n 240,\n 242,\n 243,\n 244,\n 245,\n 230,\n 232,\n 227,\n 254,\n 251,\n 253,\n 255,\n 249,\n 248,\n 252,\n 224,\n 241,\n 193,\n 194,\n 215,\n 199,\n 196,\n 197,\n 214,\n 218,\n 201,\n 202,\n 203,\n 204,\n 205,\n 206,\n 207,\n 208,\n 35,\n 35,\n 35,\n 124,\n 124,\n 124,\n 124,\n 43,\n 43,\n 124,\n 124,\n 43,\n 43,\n 43,\n 43,\n 43,\n 43,\n 45,\n 45,\n 124,\n 45,\n 43,\n 124,\n 124,\n 43,\n 43,\n 45,\n 45,\n 124,\n 45,\n 43,\n 45,\n 45,\n 45,\n 45,\n 43,\n 43,\n 43,\n 43,\n 43,\n 43,\n 43,\n 43,\n 35,\n 35,\n 124,\n 124,\n 35,\n 210,\n 211,\n 212,\n 213,\n 198,\n 200,\n 195,\n 222,\n 219,\n 221,\n 223,\n 217,\n 216,\n 220,\n 192,\n 209,\n 179,\n 163,\n 180,\n 164,\n 183,\n 167,\n 190,\n 174,\n 32,\n 149,\n 158,\n 32,\n 152,\n 159,\n 148,\n 154,\n 0,\n 1,\n 2,\n 3,\n 4,\n 5,\n 6,\n 7,\n 8,\n 9,\n 10,\n 11,\n 12,\n 13,\n 14,\n 15,\n 16,\n 17,\n 18,\n 19,\n 20,\n 21,\n 22,\n 23,\n 24,\n 25,\n 26,\n 27,\n 28,\n 29,\n 30,\n 31,\n 32,\n 33,\n 34,\n 35,\n 36,\n 37,\n 38,\n 39,\n 40,\n 41,\n 42,\n 43,\n 44,\n 45,\n 46,\n 47,\n 48,\n 49,\n 50,\n 51,\n 52,\n 53,\n 54,\n 55,\n 56,\n 57,\n 58,\n 59,\n 60,\n 61,\n 62,\n 63,\n 64,\n 65,\n 66,\n 67,\n 68,\n 69,\n 70,\n 71,\n 72,\n 73,\n 74,\n 75,\n 76,\n 77,\n 78,\n 79,\n 80,\n 81,\n 82,\n 83,\n 84,\n 85,\n 86,\n 87,\n 88,\n 89,\n 90,\n 91,\n 92,\n 93,\n 94,\n 95,\n 96,\n 97,\n 98,\n 99,\n 100,\n 101,\n 102,\n 103,\n 104,\n 105,\n 106,\n 107,\n 108,\n 109,\n 110,\n 111,\n 112,\n 113,\n 114,\n 115,\n 116,\n 117,\n 118,\n 119,\n 120,\n 121,\n 122,\n 123,\n 124,\n 125,\n 126,\n 127,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 205,\n 186,\n 213,\n 241,\n 243,\n 201,\n 32,\n 245,\n 187,\n 212,\n 211,\n 200,\n 190,\n 32,\n 247,\n 198,\n 199,\n 204,\n 181,\n 240,\n 242,\n 185,\n 32,\n 244,\n 203,\n 207,\n 208,\n 202,\n 216,\n 32,\n 246,\n 32,\n 238,\n 160,\n 161,\n 230,\n 164,\n 165,\n 228,\n 163,\n 229,\n 168,\n 169,\n 170,\n 171,\n 172,\n 173,\n 174,\n 175,\n 239,\n 224,\n 225,\n 226,\n 227,\n 166,\n 162,\n 236,\n 235,\n 167,\n 232,\n 237,\n 233,\n 231,\n 234,\n 158,\n 128,\n 129,\n 150,\n 132,\n 133,\n 148,\n 131,\n 149,\n 136,\n 137,\n 138,\n 139,\n 140,\n 141,\n 142,\n 143,\n 159,\n 144,\n 145,\n 146,\n 147,\n 134,\n 130,\n 156,\n 155,\n 135,\n 152,\n 157,\n 153,\n 151,\n 154\n ]\n var _cyrIso88595 = [\n 0,\n 1,\n 2,\n 3,\n 4,\n 5,\n 6,\n 7,\n 8,\n 9,\n 10,\n 11,\n 12,\n 13,\n 14,\n 15,\n 16,\n 17,\n 18,\n 19,\n 20,\n 21,\n 22,\n 23,\n 24,\n 25,\n 26,\n 27,\n 28,\n 29,\n 30,\n 31,\n 32,\n 33,\n 34,\n 35,\n 36,\n 37,\n 38,\n 39,\n 40,\n 41,\n 42,\n 43,\n 44,\n 45,\n 46,\n 47,\n 48,\n 49,\n 50,\n 51,\n 52,\n 53,\n 54,\n 55,\n 56,\n 57,\n 58,\n 59,\n 60,\n 61,\n 62,\n 63,\n 64,\n 65,\n 66,\n 67,\n 68,\n 69,\n 70,\n 71,\n 72,\n 73,\n 74,\n 75,\n 76,\n 77,\n 78,\n 79,\n 80,\n 81,\n 82,\n 83,\n 84,\n 85,\n 86,\n 87,\n 88,\n 89,\n 90,\n 91,\n 92,\n 93,\n 94,\n 95,\n 96,\n 97,\n 98,\n 99,\n 100,\n 101,\n 102,\n 103,\n 104,\n 105,\n 106,\n 107,\n 108,\n 109,\n 110,\n 111,\n 112,\n 113,\n 114,\n 115,\n 116,\n 117,\n 118,\n 119,\n 120,\n 121,\n 122,\n 123,\n 124,\n 125,\n 126,\n 127,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 179,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 225,\n 226,\n 247,\n 231,\n 228,\n 229,\n 246,\n 250,\n 233,\n 234,\n 235,\n 236,\n 237,\n 238,\n 239,\n 240,\n 242,\n 243,\n 244,\n 245,\n 230,\n 232,\n 227,\n 254,\n 251,\n 253,\n 255,\n 249,\n 248,\n 252,\n 224,\n 241,\n 193,\n 194,\n 215,\n 199,\n 196,\n 197,\n 214,\n 218,\n 201,\n 202,\n 203,\n 204,\n 205,\n 206,\n 207,\n 208,\n 210,\n 211,\n 212,\n 213,\n 198,\n 200,\n 195,\n 222,\n 219,\n 221,\n 223,\n 217,\n 216,\n 220,\n 192,\n 209,\n 32,\n 163,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 0,\n 1,\n 2,\n 3,\n 4,\n 5,\n 6,\n 7,\n 8,\n 9,\n 10,\n 11,\n 12,\n 13,\n 14,\n 15,\n 16,\n 17,\n 18,\n 19,\n 20,\n 21,\n 22,\n 23,\n 24,\n 25,\n 26,\n 27,\n 28,\n 29,\n 30,\n 31,\n 32,\n 33,\n 34,\n 35,\n 36,\n 37,\n 38,\n 39,\n 40,\n 41,\n 42,\n 43,\n 44,\n 45,\n 46,\n 47,\n 48,\n 49,\n 50,\n 51,\n 52,\n 53,\n 54,\n 55,\n 56,\n 57,\n 58,\n 59,\n 60,\n 61,\n 62,\n 63,\n 64,\n 65,\n 66,\n 67,\n 68,\n 69,\n 70,\n 71,\n 72,\n 73,\n 74,\n 75,\n 76,\n 77,\n 78,\n 79,\n 80,\n 81,\n 82,\n 83,\n 84,\n 85,\n 86,\n 87,\n 88,\n 89,\n 90,\n 91,\n 92,\n 93,\n 94,\n 95,\n 96,\n 97,\n 98,\n 99,\n 100,\n 101,\n 102,\n 103,\n 104,\n 105,\n 106,\n 107,\n 108,\n 109,\n 110,\n 111,\n 112,\n 113,\n 114,\n 115,\n 116,\n 117,\n 118,\n 119,\n 120,\n 121,\n 122,\n 123,\n 124,\n 125,\n 126,\n 127,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 241,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 161,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 32,\n 238,\n 208,\n 209,\n 230,\n 212,\n 213,\n 228,\n 211,\n 229,\n 216,\n 217,\n 218,\n 219,\n 220,\n 221,\n 222,\n 223,\n 239,\n 224,\n 225,\n 226,\n 227,\n 214,\n 210,\n 236,\n 235,\n 215,\n 232,\n 237,\n 233,\n 231,\n 234,\n 206,\n 176,\n 177,\n 198,\n 180,\n 181,\n 196,\n 179,\n 197,\n 184,\n 185,\n 186,\n 187,\n 188,\n 189,\n 190,\n 191,\n 207,\n 192,\n 193,\n 194,\n 195,\n 182,\n 178,\n 204,\n 203,\n 183,\n 200,\n 205,\n 201,\n 199,\n 202\n ]\n var _cyrMac = [\n 0,\n 1,\n 2,\n 3,\n 4,\n 5,\n 6,\n 7,\n 8,\n 9,\n 10,\n 11,\n 12,\n 13,\n 14,\n 15,\n 16,\n 17,\n 18,\n 19,\n 20,\n 21,\n 22,\n 23,\n 24,\n 25,\n 26,\n 27,\n 28,\n 29,\n 30,\n 31,\n 32,\n 33,\n 34,\n 35,\n 36,\n 37,\n 38,\n 39,\n 40,\n 41,\n 42,\n 43,\n 44,\n 45,\n 46,\n 47,\n 48,\n 49,\n 50,\n 51,\n 52,\n 53,\n 54,\n 55,\n 56,\n 57,\n 58,\n 59,\n 60,\n 61,\n 62,\n 63,\n 64,\n 65,\n 66,\n 67,\n 68,\n 69,\n 70,\n 71,\n 72,\n 73,\n 74,\n 75,\n 76,\n 77,\n 78,\n 79,\n 80,\n 81,\n 82,\n 83,\n 84,\n 85,\n 86,\n 87,\n 88,\n 89,\n 90,\n 91,\n 92,\n 93,\n 94,\n 95,\n 96,\n 97,\n 98,\n 99,\n 100,\n 101,\n 102,\n 103,\n 104,\n 105,\n 106,\n 107,\n 108,\n 109,\n 110,\n 111,\n 112,\n 113,\n 114,\n 115,\n 116,\n 117,\n 118,\n 119,\n 120,\n 121,\n 122,\n 123,\n 124,\n 125,\n 126,\n 127,\n 225,\n 226,\n 247,\n 231,\n 228,\n 229,\n 246,\n 250,\n 233,\n 234,\n 235,\n 236,\n 237,\n 238,\n 239,\n 240,\n 242,\n 243,\n 244,\n 245,\n 230,\n 232,\n 227,\n 254,\n 251,\n 253,\n 255,\n 249,\n 248,\n 252,\n 224,\n 241,\n 160,\n 161,\n 162,\n 163,\n 164,\n 165,\n 166,\n 167,\n 168,\n 169,\n 170,\n 171,\n 172,\n 173,\n 174,\n 175,\n 176,\n 177,\n 178,\n 179,\n 180,\n 181,\n 182,\n 183,\n 184,\n 185,\n 186,\n 187,\n 188,\n 189,\n 190,\n 191,\n 128,\n 129,\n 130,\n 131,\n 132,\n 133,\n 134,\n 135,\n 136,\n 137,\n 138,\n 139,\n 140,\n 141,\n 142,\n 143,\n 144,\n 145,\n 146,\n 147,\n 148,\n 149,\n 150,\n 151,\n 152,\n 153,\n 154,\n 155,\n 156,\n 179,\n 163,\n 209,\n 193,\n 194,\n 215,\n 199,\n 196,\n 197,\n 214,\n 218,\n 201,\n 202,\n 203,\n 204,\n 205,\n 206,\n 207,\n 208,\n 210,\n 211,\n 212,\n 213,\n 198,\n 200,\n 195,\n 222,\n 219,\n 221,\n 223,\n 217,\n 216,\n 220,\n 192,\n\n 255,\n 0,\n 1,\n 2,\n 3,\n 4,\n 5,\n 6,\n 7,\n 8,\n 9,\n 10,\n 11,\n 12,\n 13,\n 14,\n 15,\n 16,\n 17,\n 18,\n 19,\n 20,\n 21,\n 22,\n 23,\n 24,\n 25,\n 26,\n 27,\n 28,\n 29,\n 30,\n 31,\n 32,\n 33,\n 34,\n 35,\n 36,\n 37,\n 38,\n 39,\n 40,\n 41,\n 42,\n 43,\n 44,\n 45,\n 46,\n 47,\n 48,\n 49,\n 50,\n 51,\n 52,\n 53,\n 54,\n\n 55,\n 56,\n 57,\n 58,\n 59,\n 60,\n 61,\n 62,\n 63,\n 64,\n 65,\n 66,\n 67,\n 68,\n 69,\n 70,\n 71,\n 72,\n 73,\n 74,\n 75,\n 76,\n 77,\n 78,\n 79,\n 80,\n 81,\n 82,\n 83,\n 84,\n 85,\n 86,\n 87,\n 88,\n 89,\n 90,\n 91,\n 92,\n 93,\n 94,\n 95,\n 96,\n 97,\n 98,\n 99,\n 100,\n 101,\n 102,\n 103,\n 104,\n 105,\n 106,\n 107,\n 108,\n 109,\n 110,\n 111,\n 112,\n 113,\n 114,\n 115,\n 116,\n 117,\n 118,\n 119,\n 120,\n 121,\n 122,\n 123,\n 124,\n 125,\n 126,\n 127,\n 192,\n 193,\n 194,\n 195,\n 196,\n 197,\n 198,\n 199,\n 200,\n 201,\n 202,\n 203,\n 204,\n 205,\n 206,\n 207,\n 208,\n 209,\n 210,\n 211,\n 212,\n 213,\n 214,\n 215,\n 216,\n 217,\n 218,\n 219,\n 220,\n 221,\n 222,\n 223,\n 160,\n 161,\n 162,\n 222,\n 164,\n 165,\n 166,\n 167,\n 168,\n 169,\n 170,\n 171,\n 172,\n 173,\n 174,\n 175,\n 176,\n 177,\n 178,\n 221,\n 180,\n 181,\n 182,\n 183,\n 184,\n 185,\n 186,\n 187,\n 188,\n 189,\n 190,\n 191,\n 254,\n 224,\n 225,\n 246,\n 228,\n 229,\n 244,\n 227,\n 245,\n 232,\n 233,\n 234,\n 235,\n 236,\n 237,\n 238,\n 239,\n 223,\n 240,\n 241,\n\n 242,\n 243,\n 230,\n 226,\n 252,\n 251,\n 231,\n 248,\n 253,\n 249,\n 247,\n 250,\n 158,\n 128,\n 129,\n 150,\n 132,\n 133,\n 148,\n 131,\n 149,\n 136,\n 137,\n 138,\n 139,\n 140,\n 141,\n 142,\n 143,\n 159,\n 144,\n 145,\n 146,\n 147,\n 134,\n 130,\n 156,\n 155,\n 135,\n 152,\n 157,\n 153,\n 151,\n 154\n ]\n\n var fromTable = null\n var toTable = null\n var tmp\n var i = 0\n var retStr = ''\n\n switch (from.toUpperCase()) {\n case 'W':\n fromTable = _cyrWin1251\n break\n case 'A':\n case 'D':\n fromTable = _cyrCp866\n break\n case 'I':\n fromTable = _cyrIso88595\n break\n case 'M':\n fromTable = _cyrMac\n break\n case 'K':\n break\n default:\n // Can we throw a warning instead? That would be more in line with PHP\n throw new Error('Unknown source charset: ' + fromTable)\n }\n\n switch (to.toUpperCase()) {\n case 'W':\n toTable = _cyrWin1251\n break\n case 'A':\n case 'D':\n toTable = _cyrCp866\n break\n case 'I':\n toTable = _cyrIso88595\n break\n case 'M':\n toTable = _cyrMac\n break\n case 'K':\n break\n default:\n // Can we throw a warning instead? That would be more in line with PHP\n throw new Error('Unknown destination charset: ' + toTable)\n }\n\n if (!str) {\n return str\n }\n\n for (i = 0; i < str.length; i++) {\n tmp = (fromTable === null)\n ? str.charAt(i)\n : String.fromCharCode(fromTable[str.charAt(i).charCodeAt(0)])\n\n retStr += (toTable === null)\n ? tmp\n : String.fromCharCode(toTable[tmp.charCodeAt(0) + 256])\n }\n\n return retStr\n}\n"]}
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/convert_uuencode.js b/node_modules/locutus/php/strings/convert_uuencode.js new file mode 100644 index 0000000..7541512 --- /dev/null +++ b/node_modules/locutus/php/strings/convert_uuencode.js @@ -0,0 +1,81 @@ +'use strict'; + +module.exports = function convert_uuencode(str) { + // eslint-disable-line camelcase + // discuss at: http://locutus.io/php/convert_uuencode/ + // original by: Ole Vrijenhoek + // bugfixed by: Kevin van Zonneveld (http://kvz.io) + // bugfixed by: Brett Zamir (http://brett-zamir.me) + // reimplemented by: Ole Vrijenhoek + // example 1: convert_uuencode("test\ntext text\r\n") + // returns 1: "0=&5S=`IT97AT('1E>'0-\"@\n`\n" + + var isScalar = require('../var/is_scalar'); + + var chr = function chr(c) { + return String.fromCharCode(c); + }; + + if (!str || str === '') { + return chr(0); + } else if (!isScalar(str)) { + return false; + } + + var c = 0; + var u = 0; + var i = 0; + var a = 0; + var encoded = ''; + var tmp1 = ''; + var tmp2 = ''; + var bytes = {}; + + // divide string into chunks of 45 characters + var chunk = function chunk() { + bytes = str.substr(u, 45).split(''); + for (i in bytes) { + bytes[i] = bytes[i].charCodeAt(0); + } + return bytes.length || 0; + }; + + while ((c = chunk()) !== 0) { + u += 45; + + // New line encoded data starts with number of bytes encoded. + encoded += chr(c + 32); + + // Convert each char in bytes[] to a byte + for (i in bytes) { + tmp1 = bytes[i].toString(2); + while (tmp1.length < 8) { + tmp1 = '0' + tmp1; + } + tmp2 += tmp1; + } + + while (tmp2.length % 6) { + tmp2 = tmp2 + '0'; + } + + for (i = 0; i <= tmp2.length / 6 - 1; i++) { + tmp1 = tmp2.substr(a, 6); + if (tmp1 === '000000') { + encoded += chr(96); + } else { + encoded += chr(parseInt(tmp1, 2) + 32); + } + a += 6; + } + a = 0; + tmp2 = ''; + encoded += '\n'; + } + + // Add termination characters + encoded += chr(96) + '\n'; + + return encoded; +}; +//# sourceMappingURL=convert_uuencode.js.map
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/convert_uuencode.js.map b/node_modules/locutus/php/strings/convert_uuencode.js.map new file mode 100644 index 0000000..298fb92 --- /dev/null +++ b/node_modules/locutus/php/strings/convert_uuencode.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/php/strings/convert_uuencode.js"],"names":["module","exports","convert_uuencode","str","isScalar","require","chr","c","String","fromCharCode","u","i","a","encoded","tmp1","tmp2","bytes","chunk","substr","split","charCodeAt","length","toString","parseInt"],"mappings":";;AAAAA,OAAOC,OAAP,GAAiB,SAASC,gBAAT,CAA2BC,GAA3B,EAAgC;AAAE;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,MAAIC,WAAWC,QAAQ,kBAAR,CAAf;;AAEA,MAAIC,MAAM,SAANA,GAAM,CAAUC,CAAV,EAAa;AACrB,WAAOC,OAAOC,YAAP,CAAoBF,CAApB,CAAP;AACD,GAFD;;AAIA,MAAI,CAACJ,GAAD,IAAQA,QAAQ,EAApB,EAAwB;AACtB,WAAOG,IAAI,CAAJ,CAAP;AACD,GAFD,MAEO,IAAI,CAACF,SAASD,GAAT,CAAL,EAAoB;AACzB,WAAO,KAAP;AACD;;AAED,MAAII,IAAI,CAAR;AACA,MAAIG,IAAI,CAAR;AACA,MAAIC,IAAI,CAAR;AACA,MAAIC,IAAI,CAAR;AACA,MAAIC,UAAU,EAAd;AACA,MAAIC,OAAO,EAAX;AACA,MAAIC,OAAO,EAAX;AACA,MAAIC,QAAQ,EAAZ;;AAEA;AACA,MAAIC,QAAQ,SAARA,KAAQ,GAAY;AACtBD,YAAQb,IAAIe,MAAJ,CAAWR,CAAX,EAAc,EAAd,EAAkBS,KAAlB,CAAwB,EAAxB,CAAR;AACA,SAAKR,CAAL,IAAUK,KAAV,EAAiB;AACfA,YAAML,CAAN,IAAWK,MAAML,CAAN,EAASS,UAAT,CAAoB,CAApB,CAAX;AACD;AACD,WAAOJ,MAAMK,MAAN,IAAgB,CAAvB;AACD,GAND;;AAQA,SAAO,CAACd,IAAIU,OAAL,MAAkB,CAAzB,EAA4B;AAC1BP,SAAK,EAAL;;AAEA;AACAG,eAAWP,IAAIC,IAAI,EAAR,CAAX;;AAEA;AACA,SAAKI,CAAL,IAAUK,KAAV,EAAiB;AACfF,aAAOE,MAAML,CAAN,EAASW,QAAT,CAAkB,CAAlB,CAAP;AACA,aAAOR,KAAKO,MAAL,GAAc,CAArB,EAAwB;AACtBP,eAAO,MAAMA,IAAb;AACD;AACDC,cAAQD,IAAR;AACD;;AAED,WAAOC,KAAKM,MAAL,GAAc,CAArB,EAAwB;AACtBN,aAAOA,OAAO,GAAd;AACD;;AAED,SAAKJ,IAAI,CAAT,EAAYA,KAAMI,KAAKM,MAAL,GAAc,CAAf,GAAoB,CAArC,EAAwCV,GAAxC,EAA6C;AAC3CG,aAAOC,KAAKG,MAAL,CAAYN,CAAZ,EAAe,CAAf,CAAP;AACA,UAAIE,SAAS,QAAb,EAAuB;AACrBD,mBAAWP,IAAI,EAAJ,CAAX;AACD,OAFD,MAEO;AACLO,mBAAWP,IAAIiB,SAAST,IAAT,EAAe,CAAf,IAAoB,EAAxB,CAAX;AACD;AACDF,WAAK,CAAL;AACD;AACDA,QAAI,CAAJ;AACAG,WAAO,EAAP;AACAF,eAAW,IAAX;AACD;;AAED;AACAA,aAAWP,IAAI,EAAJ,IAAU,IAArB;;AAEA,SAAOO,OAAP;AACD,CA5ED","file":"convert_uuencode.js","sourcesContent":["module.exports = function convert_uuencode (str) { // eslint-disable-line camelcase\n // discuss at: http://locutus.io/php/convert_uuencode/\n // original by: Ole Vrijenhoek\n // bugfixed by: Kevin van Zonneveld (http://kvz.io)\n // bugfixed by: Brett Zamir (http://brett-zamir.me)\n // reimplemented by: Ole Vrijenhoek\n // example 1: convert_uuencode(\"test\\ntext text\\r\\n\")\n // returns 1: \"0=&5S=`IT97AT('1E>'0-\\\"@\\n`\\n\"\n\n var isScalar = require('../var/is_scalar')\n\n var chr = function (c) {\n return String.fromCharCode(c)\n }\n\n if (!str || str === '') {\n return chr(0)\n } else if (!isScalar(str)) {\n return false\n }\n\n var c = 0\n var u = 0\n var i = 0\n var a = 0\n var encoded = ''\n var tmp1 = ''\n var tmp2 = ''\n var bytes = {}\n\n // divide string into chunks of 45 characters\n var chunk = function () {\n bytes = str.substr(u, 45).split('')\n for (i in bytes) {\n bytes[i] = bytes[i].charCodeAt(0)\n }\n return bytes.length || 0\n }\n\n while ((c = chunk()) !== 0) {\n u += 45\n\n // New line encoded data starts with number of bytes encoded.\n encoded += chr(c + 32)\n\n // Convert each char in bytes[] to a byte\n for (i in bytes) {\n tmp1 = bytes[i].toString(2)\n while (tmp1.length < 8) {\n tmp1 = '0' + tmp1\n }\n tmp2 += tmp1\n }\n\n while (tmp2.length % 6) {\n tmp2 = tmp2 + '0'\n }\n\n for (i = 0; i <= (tmp2.length / 6) - 1; i++) {\n tmp1 = tmp2.substr(a, 6)\n if (tmp1 === '000000') {\n encoded += chr(96)\n } else {\n encoded += chr(parseInt(tmp1, 2) + 32)\n }\n a += 6\n }\n a = 0\n tmp2 = ''\n encoded += '\\n'\n }\n\n // Add termination characters\n encoded += chr(96) + '\\n'\n\n return encoded\n}\n"]}
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/count_chars.js b/node_modules/locutus/php/strings/count_chars.js new file mode 100644 index 0000000..2e3f0ed --- /dev/null +++ b/node_modules/locutus/php/strings/count_chars.js @@ -0,0 +1,55 @@ +'use strict'; + +module.exports = function count_chars(str, mode) { + // eslint-disable-line camelcase + // discuss at: http://locutus.io/php/count_chars/ + // original by: Ates Goral (http://magnetiq.com) + // improved by: Jack + // bugfixed by: Onno Marsman (https://twitter.com/onnomarsman) + // bugfixed by: Kevin van Zonneveld (http://kvz.io) + // input by: Brett Zamir (http://brett-zamir.me) + // revised by: Theriault (https://github.com/Theriault) + // example 1: count_chars("Hello World!", 3) + // returns 1: " !HWdelor" + // example 2: count_chars("Hello World!", 1) + // returns 2: {32:1,33:1,72:1,87:1,100:1,101:1,108:3,111:2,114:1} + + var result = {}; + var resultArr = []; + var i; + + str = ('' + str).split('').sort().join('').match(/(.)\1*/g); + + if ((mode & 1) === 0) { + for (i = 0; i !== 256; i++) { + result[i] = 0; + } + } + + if (mode === 2 || mode === 4) { + for (i = 0; i !== str.length; i += 1) { + delete result[str[i].charCodeAt(0)]; + } + for (i in result) { + result[i] = mode === 4 ? String.fromCharCode(i) : 0; + } + } else if (mode === 3) { + for (i = 0; i !== str.length; i += 1) { + result[i] = str[i].slice(0, 1); + } + } else { + for (i = 0; i !== str.length; i += 1) { + result[str[i].charCodeAt(0)] = str[i].length; + } + } + if (mode < 3) { + return result; + } + + for (i in result) { + resultArr.push(result[i]); + } + + return resultArr.join(''); +}; +//# sourceMappingURL=count_chars.js.map
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/count_chars.js.map b/node_modules/locutus/php/strings/count_chars.js.map new file mode 100644 index 0000000..bd2c885 --- /dev/null +++ b/node_modules/locutus/php/strings/count_chars.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/php/strings/count_chars.js"],"names":["module","exports","count_chars","str","mode","result","resultArr","i","split","sort","join","match","length","charCodeAt","String","fromCharCode","slice","push"],"mappings":";;AAAAA,OAAOC,OAAP,GAAiB,SAASC,WAAT,CAAsBC,GAAtB,EAA2BC,IAA3B,EAAiC;AAAE;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,MAAIC,SAAS,EAAb;AACA,MAAIC,YAAY,EAAhB;AACA,MAAIC,CAAJ;;AAEAJ,QAAM,CAAC,KAAKA,GAAN,EACHK,KADG,CACG,EADH,EAEHC,IAFG,GAGHC,IAHG,CAGE,EAHF,EAIHC,KAJG,CAIG,SAJH,CAAN;;AAMA,MAAI,CAACP,OAAO,CAAR,MAAe,CAAnB,EAAsB;AACpB,SAAKG,IAAI,CAAT,EAAYA,MAAM,GAAlB,EAAuBA,GAAvB,EAA4B;AAC1BF,aAAOE,CAAP,IAAY,CAAZ;AACD;AACF;;AAED,MAAIH,SAAS,CAAT,IAAcA,SAAS,CAA3B,EAA8B;AAC5B,SAAKG,IAAI,CAAT,EAAYA,MAAMJ,IAAIS,MAAtB,EAA8BL,KAAK,CAAnC,EAAsC;AACpC,aAAOF,OAAOF,IAAII,CAAJ,EAAOM,UAAP,CAAkB,CAAlB,CAAP,CAAP;AACD;AACD,SAAKN,CAAL,IAAUF,MAAV,EAAkB;AAChBA,aAAOE,CAAP,IAAaH,SAAS,CAAV,GAAeU,OAAOC,YAAP,CAAoBR,CAApB,CAAf,GAAwC,CAApD;AACD;AACF,GAPD,MAOO,IAAIH,SAAS,CAAb,EAAgB;AACrB,SAAKG,IAAI,CAAT,EAAYA,MAAMJ,IAAIS,MAAtB,EAA8BL,KAAK,CAAnC,EAAsC;AACpCF,aAAOE,CAAP,IAAYJ,IAAII,CAAJ,EAAOS,KAAP,CAAa,CAAb,EAAgB,CAAhB,CAAZ;AACD;AACF,GAJM,MAIA;AACL,SAAKT,IAAI,CAAT,EAAYA,MAAMJ,IAAIS,MAAtB,EAA8BL,KAAK,CAAnC,EAAsC;AACpCF,aAAOF,IAAII,CAAJ,EAAOM,UAAP,CAAkB,CAAlB,CAAP,IAA+BV,IAAII,CAAJ,EAAOK,MAAtC;AACD;AACF;AACD,MAAIR,OAAO,CAAX,EAAc;AACZ,WAAOC,MAAP;AACD;;AAED,OAAKE,CAAL,IAAUF,MAAV,EAAkB;AAChBC,cAAUW,IAAV,CAAeZ,OAAOE,CAAP,CAAf;AACD;;AAED,SAAOD,UAAUI,IAAV,CAAe,EAAf,CAAP;AACD,CAtDD","file":"count_chars.js","sourcesContent":["module.exports = function count_chars (str, mode) { // eslint-disable-line camelcase\n // discuss at: http://locutus.io/php/count_chars/\n // original by: Ates Goral (http://magnetiq.com)\n // improved by: Jack\n // bugfixed by: Onno Marsman (https://twitter.com/onnomarsman)\n // bugfixed by: Kevin van Zonneveld (http://kvz.io)\n // input by: Brett Zamir (http://brett-zamir.me)\n // revised by: Theriault (https://github.com/Theriault)\n // example 1: count_chars(\"Hello World!\", 3)\n // returns 1: \" !HWdelor\"\n // example 2: count_chars(\"Hello World!\", 1)\n // returns 2: {32:1,33:1,72:1,87:1,100:1,101:1,108:3,111:2,114:1}\n\n var result = {}\n var resultArr = []\n var i\n\n str = ('' + str)\n .split('')\n .sort()\n .join('')\n .match(/(.)\\1*/g)\n\n if ((mode & 1) === 0) {\n for (i = 0; i !== 256; i++) {\n result[i] = 0\n }\n }\n\n if (mode === 2 || mode === 4) {\n for (i = 0; i !== str.length; i += 1) {\n delete result[str[i].charCodeAt(0)]\n }\n for (i in result) {\n result[i] = (mode === 4) ? String.fromCharCode(i) : 0\n }\n } else if (mode === 3) {\n for (i = 0; i !== str.length; i += 1) {\n result[i] = str[i].slice(0, 1)\n }\n } else {\n for (i = 0; i !== str.length; i += 1) {\n result[str[i].charCodeAt(0)] = str[i].length\n }\n }\n if (mode < 3) {\n return result\n }\n\n for (i in result) {\n resultArr.push(result[i])\n }\n\n return resultArr.join('')\n}\n"]}
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/crc32.js b/node_modules/locutus/php/strings/crc32.js new file mode 100644 index 0000000..0387bda --- /dev/null +++ b/node_modules/locutus/php/strings/crc32.js @@ -0,0 +1,29 @@ +'use strict'; + +module.exports = function crc32(str) { + // discuss at: http://locutus.io/php/crc32/ + // original by: Webtoolkit.info (http://www.webtoolkit.info/) + // improved by: T0bsn + // example 1: crc32('Kevin van Zonneveld') + // returns 1: 1249991249 + + var utf8Encode = require('../xml/utf8_encode'); + str = utf8Encode(str); + var table = ['00000000', '77073096', 'EE0E612C', '990951BA', '076DC419', '706AF48F', 'E963A535', '9E6495A3', '0EDB8832', '79DCB8A4', 'E0D5E91E', '97D2D988', '09B64C2B', '7EB17CBD', 'E7B82D07', '90BF1D91', '1DB71064', '6AB020F2', 'F3B97148', '84BE41DE', '1ADAD47D', '6DDDE4EB', 'F4D4B551', '83D385C7', '136C9856', '646BA8C0', 'FD62F97A', '8A65C9EC', '14015C4F', '63066CD9', 'FA0F3D63', '8D080DF5', '3B6E20C8', '4C69105E', 'D56041E4', 'A2677172', '3C03E4D1', '4B04D447', 'D20D85FD', 'A50AB56B', '35B5A8FA', '42B2986C', 'DBBBC9D6', 'ACBCF940', '32D86CE3', '45DF5C75', 'DCD60DCF', 'ABD13D59', '26D930AC', '51DE003A', 'C8D75180', 'BFD06116', '21B4F4B5', '56B3C423', 'CFBA9599', 'B8BDA50F', '2802B89E', '5F058808', 'C60CD9B2', 'B10BE924', '2F6F7C87', '58684C11', 'C1611DAB', 'B6662D3D', '76DC4190', '01DB7106', '98D220BC', 'EFD5102A', '71B18589', '06B6B51F', '9FBFE4A5', 'E8B8D433', '7807C9A2', '0F00F934', '9609A88E', 'E10E9818', '7F6A0DBB', '086D3D2D', '91646C97', 'E6635C01', '6B6B51F4', '1C6C6162', '856530D8', 'F262004E', '6C0695ED', '1B01A57B', '8208F4C1', 'F50FC457', '65B0D9C6', '12B7E950', '8BBEB8EA', 'FCB9887C', '62DD1DDF', '15DA2D49', '8CD37CF3', 'FBD44C65', '4DB26158', '3AB551CE', 'A3BC0074', 'D4BB30E2', '4ADFA541', '3DD895D7', 'A4D1C46D', 'D3D6F4FB', '4369E96A', '346ED9FC', 'AD678846', 'DA60B8D0', '44042D73', '33031DE5', 'AA0A4C5F', 'DD0D7CC9', '5005713C', '270241AA', 'BE0B1010', 'C90C2086', '5768B525', '206F85B3', 'B966D409', 'CE61E49F', '5EDEF90E', '29D9C998', 'B0D09822', 'C7D7A8B4', '59B33D17', '2EB40D81', 'B7BD5C3B', 'C0BA6CAD', 'EDB88320', '9ABFB3B6', '03B6E20C', '74B1D29A', 'EAD54739', '9DD277AF', '04DB2615', '73DC1683', 'E3630B12', '94643B84', '0D6D6A3E', '7A6A5AA8', 'E40ECF0B', '9309FF9D', '0A00AE27', '7D079EB1', 'F00F9344', '8708A3D2', '1E01F268', '6906C2FE', 'F762575D', '806567CB', '196C3671', '6E6B06E7', 'FED41B76', '89D32BE0', '10DA7A5A', '67DD4ACC', 'F9B9DF6F', '8EBEEFF9', '17B7BE43', '60B08ED5', 'D6D6A3E8', 'A1D1937E', '38D8C2C4', '4FDFF252', 'D1BB67F1', 'A6BC5767', '3FB506DD', '48B2364B', 'D80D2BDA', 'AF0A1B4C', '36034AF6', '41047A60', 'DF60EFC3', 'A867DF55', '316E8EEF', '4669BE79', 'CB61B38C', 'BC66831A', '256FD2A0', '5268E236', 'CC0C7795', 'BB0B4703', '220216B9', '5505262F', 'C5BA3BBE', 'B2BD0B28', '2BB45A92', '5CB36A04', 'C2D7FFA7', 'B5D0CF31', '2CD99E8B', '5BDEAE1D', '9B64C2B0', 'EC63F226', '756AA39C', '026D930A', '9C0906A9', 'EB0E363F', '72076785', '05005713', '95BF4A82', 'E2B87A14', '7BB12BAE', '0CB61B38', '92D28E9B', 'E5D5BE0D', '7CDCEFB7', '0BDBDF21', '86D3D2D4', 'F1D4E242', '68DDB3F8', '1FDA836E', '81BE16CD', 'F6B9265B', '6FB077E1', '18B74777', '88085AE6', 'FF0F6A70', '66063BCA', '11010B5C', '8F659EFF', 'F862AE69', '616BFFD3', '166CCF45', 'A00AE278', 'D70DD2EE', '4E048354', '3903B3C2', 'A7672661', 'D06016F7', '4969474D', '3E6E77DB', 'AED16A4A', 'D9D65ADC', '40DF0B66', '37D83BF0', 'A9BCAE53', 'DEBB9EC5', '47B2CF7F', '30B5FFE9', 'BDBDF21C', 'CABAC28A', '53B39330', '24B4A3A6', 'BAD03605', 'CDD70693', '54DE5729', '23D967BF', 'B3667A2E', 'C4614AB8', '5D681B02', '2A6F2B94', 'B40BBE37', 'C30C8EA1', '5A05DF1B', '2D02EF8D'].join(' '); + // @todo: ^-- Now that `table` is an array, maybe we can use that directly using slices, + // instead of converting it to a string and substringing + + var crc = 0; + var x = 0; + var y = 0; + + crc = crc ^ -1; + for (var i = 0, iTop = str.length; i < iTop; i++) { + y = (crc ^ str.charCodeAt(i)) & 0xFF; + x = '0x' + table.substr(y * 9, 8); + crc = crc >>> 8 ^ x; + } + + return crc ^ -1; +}; +//# sourceMappingURL=crc32.js.map
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/crc32.js.map b/node_modules/locutus/php/strings/crc32.js.map new file mode 100644 index 0000000..aeea2b0 --- /dev/null +++ b/node_modules/locutus/php/strings/crc32.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/php/strings/crc32.js"],"names":["module","exports","crc32","str","utf8Encode","require","table","join","crc","x","y","i","iTop","length","charCodeAt","substr"],"mappings":";;AAAAA,OAAOC,OAAP,GAAiB,SAASC,KAAT,CAAgBC,GAAhB,EAAqB;AACpC;AACA;AACA;AACA;AACA;;AAEA,MAAIC,aAAaC,QAAQ,oBAAR,CAAjB;AACAF,QAAMC,WAAWD,GAAX,CAAN;AACA,MAAIG,QAAQ,CACV,UADU,EAEV,UAFU,EAGV,UAHU,EAIV,UAJU,EAKV,UALU,EAMV,UANU,EAOV,UAPU,EAQV,UARU,EASV,UATU,EAUV,UAVU,EAWV,UAXU,EAYV,UAZU,EAaV,UAbU,EAcV,UAdU,EAeV,UAfU,EAgBV,UAhBU,EAiBV,UAjBU,EAkBV,UAlBU,EAmBV,UAnBU,EAoBV,UApBU,EAqBV,UArBU,EAsBV,UAtBU,EAuBV,UAvBU,EAwBV,UAxBU,EAyBV,UAzBU,EA0BV,UA1BU,EA2BV,UA3BU,EA4BV,UA5BU,EA6BV,UA7BU,EA8BV,UA9BU,EA+BV,UA/BU,EAgCV,UAhCU,EAiCV,UAjCU,EAkCV,UAlCU,EAmCV,UAnCU,EAoCV,UApCU,EAqCV,UArCU,EAsCV,UAtCU,EAuCV,UAvCU,EAwCV,UAxCU,EAyCV,UAzCU,EA0CV,UA1CU,EA2CV,UA3CU,EA4CV,UA5CU,EA6CV,UA7CU,EA8CV,UA9CU,EA+CV,UA/CU,EAgDV,UAhDU,EAiDV,UAjDU,EAkDV,UAlD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V,UA/NU,EAgOV,UAhOU,EAiOV,UAjOU,EAkOV,UAlOU,EAmOV,UAnOU,EAoOV,UApOU,EAqOV,UArOU,EAsOV,UAtOU,EAuOV,UAvOU,EAwOV,UAxOU,EAyOV,UAzOU,EA0OV,UA1OU,EA2OV,UA3OU,EA4OV,UA5OU,EA6OV,UA7OU,EA8OV,UA9OU,EA+OV,UA/OU,EAgPV,UAhPU,EAiPV,UAjPU,EAkPV,UAlPU,EAmPV,UAnPU,EAoPV,UApPU,EAqPV,UArPU,EAsPV,UAtPU,EAuPV,UAvPU,EAwPV,UAxPU,EAyPV,UAzPU,EA0PV,UA1PU,EA2PV,UA3PU,EA4PV,UA5PU,EA6PV,UA7PU,EA8PV,UA9PU,EA+PV,UA/PU,EAgQV,UAhQU,EAiQVC,IAjQU,CAiQL,GAjQK,CAAZ;AAkQA;AACA;;AAEA,MAAIC,MAAM,CAAV;AACA,MAAIC,IAAI,CAAR;AACA,MAAIC,IAAI,CAAR;;AAEAF,QAAMA,MAAO,CAAC,CAAd;AACA,OAAK,IAAIG,IAAI,CAAR,EAAWC,OAAOT,IAAIU,MAA3B,EAAmCF,IAAIC,IAAvC,EAA6CD,GAA7C,EAAkD;AAChDD,QAAI,CAACF,MAAML,IAAIW,UAAJ,CAAeH,CAAf,CAAP,IAA4B,IAAhC;AACAF,QAAI,OAAOH,MAAMS,MAAN,CAAaL,IAAI,CAAjB,EAAoB,CAApB,CAAX;AACAF,UAAOA,QAAQ,CAAT,GAAcC,CAApB;AACD;;AAED,SAAOD,MAAO,CAAC,CAAf;AACD,CA1RD","file":"crc32.js","sourcesContent":["module.exports = function crc32 (str) {\n // discuss at: http://locutus.io/php/crc32/\n // original by: Webtoolkit.info (http://www.webtoolkit.info/)\n // improved by: T0bsn\n // example 1: crc32('Kevin van Zonneveld')\n // returns 1: 1249991249\n\n var utf8Encode = require('../xml/utf8_encode')\n str = utf8Encode(str)\n var table = [\n '00000000',\n '77073096',\n 'EE0E612C',\n '990951BA',\n '076DC419',\n '706AF48F',\n 'E963A535',\n '9E6495A3',\n '0EDB8832',\n '79DCB8A4',\n 'E0D5E91E',\n '97D2D988',\n '09B64C2B',\n '7EB17CBD',\n 'E7B82D07',\n '90BF1D91',\n '1DB71064',\n '6AB020F2',\n 'F3B97148',\n '84BE41DE',\n '1ADAD47D',\n '6DDDE4EB',\n 'F4D4B551',\n '83D385C7',\n '136C9856',\n '646BA8C0',\n 'FD62F97A',\n '8A65C9EC',\n '14015C4F',\n '63066CD9',\n 'FA0F3D63',\n '8D080DF5',\n '3B6E20C8',\n '4C69105E',\n 'D56041E4',\n 'A2677172',\n '3C03E4D1',\n '4B04D447',\n 'D20D85FD',\n 'A50AB56B',\n '35B5A8FA',\n '42B2986C',\n 'DBBBC9D6',\n 'ACBCF940',\n '32D86CE3',\n '45DF5C75',\n 'DCD60DCF',\n 'ABD13D59',\n '26D930AC',\n '51DE003A',\n 'C8D75180',\n 'BFD06116',\n '21B4F4B5',\n '56B3C423',\n 'CFBA9599',\n 'B8BDA50F',\n '2802B89E',\n '5F058808',\n 'C60CD9B2',\n 'B10BE924',\n '2F6F7C87',\n '58684C11',\n 'C1611DAB',\n 'B6662D3D',\n '76DC4190',\n '01DB7106',\n '98D220BC',\n 'EFD5102A',\n '71B18589',\n '06B6B51F',\n '9FBFE4A5',\n 'E8B8D433',\n '7807C9A2',\n '0F00F934',\n '9609A88E',\n 'E10E9818',\n '7F6A0DBB',\n '086D3D2D',\n '91646C97',\n 'E6635C01',\n '6B6B51F4',\n '1C6C6162',\n '856530D8',\n 'F262004E',\n '6C0695ED',\n '1B01A57B',\n '8208F4C1',\n 'F50FC457',\n '65B0D9C6',\n '12B7E950',\n '8BBEB8EA',\n 'FCB9887C',\n '62DD1DDF',\n '15DA2D49',\n '8CD37CF3',\n 'FBD44C65',\n '4DB26158',\n '3AB551CE',\n 'A3BC0074',\n 'D4BB30E2',\n '4ADFA541',\n '3DD895D7',\n 'A4D1C46D',\n 'D3D6F4FB',\n '4369E96A',\n '346ED9FC',\n 'AD678846',\n 'DA60B8D0',\n '44042D73',\n '33031DE5',\n 'AA0A4C5F',\n 'DD0D7CC9',\n '5005713C',\n '270241AA',\n 'BE0B1010',\n 'C90C2086',\n '5768B525',\n '206F85B3',\n 'B966D409',\n 'CE61E49F',\n '5EDEF90E',\n '29D9C998',\n 'B0D09822',\n 'C7D7A8B4',\n '59B33D17',\n '2EB40D81',\n 'B7BD5C3B',\n 'C0BA6CAD',\n 'EDB88320',\n '9ABFB3B6',\n '03B6E20C',\n '74B1D29A',\n 'EAD54739',\n '9DD277AF',\n '04DB2615',\n '73DC1683',\n 'E3630B12',\n '94643B84',\n '0D6D6A3E',\n '7A6A5AA8',\n 'E40ECF0B',\n '9309FF9D',\n '0A00AE27',\n '7D079EB1',\n 'F00F9344',\n '8708A3D2',\n '1E01F268',\n '6906C2FE',\n 'F762575D',\n '806567CB',\n '196C3671',\n '6E6B06E7',\n 'FED41B76',\n '89D32BE0',\n '10DA7A5A',\n '67DD4ACC',\n 'F9B9DF6F',\n '8EBEEFF9',\n '17B7BE43',\n '60B08ED5',\n 'D6D6A3E8',\n 'A1D1937E',\n '38D8C2C4',\n '4FDFF252',\n 'D1BB67F1',\n 'A6BC5767',\n '3FB506DD',\n '48B2364B',\n 'D80D2BDA',\n 'AF0A1B4C',\n '36034AF6',\n '41047A60',\n 'DF60EFC3',\n 'A867DF55',\n '316E8EEF',\n '4669BE79',\n 'CB61B38C',\n 'BC66831A',\n '256FD2A0',\n '5268E236',\n 'CC0C7795',\n 'BB0B4703',\n '220216B9',\n '5505262F',\n 'C5BA3BBE',\n 'B2BD0B28',\n '2BB45A92',\n '5CB36A04',\n 'C2D7FFA7',\n 'B5D0CF31',\n '2CD99E8B',\n '5BDEAE1D',\n '9B64C2B0',\n 'EC63F226',\n '756AA39C',\n '026D930A',\n '9C0906A9',\n 'EB0E363F',\n '72076785',\n '05005713',\n '95BF4A82',\n 'E2B87A14',\n '7BB12BAE',\n '0CB61B38',\n '92D28E9B',\n 'E5D5BE0D',\n '7CDCEFB7',\n '0BDBDF21',\n '86D3D2D4',\n 'F1D4E242',\n '68DDB3F8',\n '1FDA836E',\n '81BE16CD',\n 'F6B9265B',\n '6FB077E1',\n '18B74777',\n '88085AE6',\n 'FF0F6A70',\n '66063BCA',\n '11010B5C',\n '8F659EFF',\n 'F862AE69',\n '616BFFD3',\n '166CCF45',\n 'A00AE278',\n 'D70DD2EE',\n '4E048354',\n '3903B3C2',\n 'A7672661',\n 'D06016F7',\n '4969474D',\n '3E6E77DB',\n 'AED16A4A',\n 'D9D65ADC',\n '40DF0B66',\n '37D83BF0',\n 'A9BCAE53',\n 'DEBB9EC5',\n '47B2CF7F',\n '30B5FFE9',\n 'BDBDF21C',\n 'CABAC28A',\n '53B39330',\n '24B4A3A6',\n 'BAD03605',\n 'CDD70693',\n '54DE5729',\n '23D967BF',\n 'B3667A2E',\n 'C4614AB8',\n '5D681B02',\n '2A6F2B94',\n 'B40BBE37',\n 'C30C8EA1',\n '5A05DF1B',\n '2D02EF8D'\n ].join(' ')\n // @todo: ^-- Now that `table` is an array, maybe we can use that directly using slices,\n // instead of converting it to a string and substringing\n\n var crc = 0\n var x = 0\n var y = 0\n\n crc = crc ^ (-1)\n for (var i = 0, iTop = str.length; i < iTop; i++) {\n y = (crc ^ str.charCodeAt(i)) & 0xFF\n x = '0x' + table.substr(y * 9, 8)\n crc = (crc >>> 8) ^ x\n }\n\n return crc ^ (-1)\n}\n"]}
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/echo.js b/node_modules/locutus/php/strings/echo.js new file mode 100644 index 0000000..cdd8433 --- /dev/null +++ b/node_modules/locutus/php/strings/echo.js @@ -0,0 +1,32 @@ +'use strict'; + +module.exports = function echo() { + // discuss at: http://locutus.io/php/echo/ + // original by: Philip Peterson + // improved by: echo is bad + // improved by: Nate + // improved by: Brett Zamir (http://brett-zamir.me) + // improved by: Brett Zamir (http://brett-zamir.me) + // improved by: Brett Zamir (http://brett-zamir.me) + // revised by: Der Simon (http://innerdom.sourceforge.net/) + // bugfixed by: Eugene Bulkin (http://doubleaw.com/) + // bugfixed by: Brett Zamir (http://brett-zamir.me) + // bugfixed by: Brett Zamir (http://brett-zamir.me) + // bugfixed by: EdorFaus + // note 1: In 1.3.2 and earlier, this function wrote to the body of the document when it + // note 1: was called in webbrowsers, in addition to supporting XUL. + // note 1: This involved >100 lines of boilerplate to do this in a safe way. + // note 1: Since I can't imageine a complelling use-case for this, and XUL is deprecated + // note 1: I have removed this behavior in favor of just calling `console.log` + // note 2: You'll see functions depends on `echo` instead of `console.log` as we'll want + // note 2: to have 1 contact point to interface with the outside world, so that it's easy + // note 2: to support other ways of printing output. + // revised by: Kevin van Zonneveld (http://kvz.io) + // input by: JB + // example 1: echo('Hello world') + // returns 1: undefined + + var args = Array.prototype.slice.call(arguments); + return console.log(args.join(' ')); +}; +//# sourceMappingURL=echo.js.map
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/echo.js.map b/node_modules/locutus/php/strings/echo.js.map new file mode 100644 index 0000000..c75e2e1 --- /dev/null +++ b/node_modules/locutus/php/strings/echo.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/php/strings/echo.js"],"names":["module","exports","echo","args","Array","prototype","slice","call","arguments","console","log","join"],"mappings":";;AAAAA,OAAOC,OAAP,GAAiB,SAASC,IAAT,GAAiB;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,MAAIC,OAAOC,MAAMC,SAAN,CAAgBC,KAAhB,CAAsBC,IAAtB,CAA2BC,SAA3B,CAAX;AACA,SAAOC,QAAQC,GAAR,CAAYP,KAAKQ,IAAL,CAAU,GAAV,CAAZ,CAAP;AACD,CA5BD","file":"echo.js","sourcesContent":["module.exports = function echo () {\n // discuss at: http://locutus.io/php/echo/\n // original by: Philip Peterson\n // improved by: echo is bad\n // improved by: Nate\n // improved by: Brett Zamir (http://brett-zamir.me)\n // improved by: Brett Zamir (http://brett-zamir.me)\n // improved by: Brett Zamir (http://brett-zamir.me)\n // revised by: Der Simon (http://innerdom.sourceforge.net/)\n // bugfixed by: Eugene Bulkin (http://doubleaw.com/)\n // bugfixed by: Brett Zamir (http://brett-zamir.me)\n // bugfixed by: Brett Zamir (http://brett-zamir.me)\n // bugfixed by: EdorFaus\n // note 1: In 1.3.2 and earlier, this function wrote to the body of the document when it\n // note 1: was called in webbrowsers, in addition to supporting XUL.\n // note 1: This involved >100 lines of boilerplate to do this in a safe way.\n // note 1: Since I can't imageine a complelling use-case for this, and XUL is deprecated\n // note 1: I have removed this behavior in favor of just calling `console.log`\n // note 2: You'll see functions depends on `echo` instead of `console.log` as we'll want\n // note 2: to have 1 contact point to interface with the outside world, so that it's easy\n // note 2: to support other ways of printing output.\n // revised by: Kevin van Zonneveld (http://kvz.io)\n // input by: JB\n // example 1: echo('Hello world')\n // returns 1: undefined\n\n var args = Array.prototype.slice.call(arguments)\n return console.log(args.join(' '))\n}\n"]}
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/explode.js b/node_modules/locutus/php/strings/explode.js new file mode 100644 index 0000000..d9bbd9e --- /dev/null +++ b/node_modules/locutus/php/strings/explode.js @@ -0,0 +1,53 @@ +'use strict'; + +var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; + +module.exports = function explode(delimiter, string, limit) { + // discuss at: http://locutus.io/php/explode/ + // original by: Kevin van Zonneveld (http://kvz.io) + // example 1: explode(' ', 'Kevin van Zonneveld') + // returns 1: [ 'Kevin', 'van', 'Zonneveld' ] + + if (arguments.length < 2 || typeof delimiter === 'undefined' || typeof string === 'undefined') { + return null; + } + if (delimiter === '' || delimiter === false || delimiter === null) { + return false; + } + if (typeof delimiter === 'function' || (typeof delimiter === 'undefined' ? 'undefined' : _typeof(delimiter)) === 'object' || typeof string === 'function' || (typeof string === 'undefined' ? 'undefined' : _typeof(string)) === 'object') { + return { + 0: '' + }; + } + if (delimiter === true) { + delimiter = '1'; + } + + // Here we go... + delimiter += ''; + string += ''; + + var s = string.split(delimiter); + + if (typeof limit === 'undefined') return s; + + // Support for limit + if (limit === 0) limit = 1; + + // Positive limit + if (limit > 0) { + if (limit >= s.length) { + return s; + } + return s.slice(0, limit - 1).concat([s.slice(limit - 1).join(delimiter)]); + } + + // Negative limit + if (-limit >= s.length) { + return []; + } + + s.splice(s.length + limit); + return s; +}; +//# sourceMappingURL=explode.js.map
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/explode.js.map b/node_modules/locutus/php/strings/explode.js.map new file mode 100644 index 0000000..f3962a9 --- /dev/null +++ b/node_modules/locutus/php/strings/explode.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/php/strings/explode.js"],"names":["module","exports","explode","delimiter","string","limit","arguments","length","s","split","slice","concat","join","splice"],"mappings":";;;;AAAAA,OAAOC,OAAP,GAAiB,SAASC,OAAT,CAAkBC,SAAlB,EAA6BC,MAA7B,EAAqCC,KAArC,EAA4C;AAC3D;AACA;AACA;AACA;;AAEA,MAAIC,UAAUC,MAAV,GAAmB,CAAnB,IACF,OAAOJ,SAAP,KAAqB,WADnB,IAEF,OAAOC,MAAP,KAAkB,WAFpB,EAEiC;AAC/B,WAAO,IAAP;AACD;AACD,MAAID,cAAc,EAAd,IACFA,cAAc,KADZ,IAEFA,cAAc,IAFhB,EAEsB;AACpB,WAAO,KAAP;AACD;AACD,MAAI,OAAOA,SAAP,KAAqB,UAArB,IACF,QAAOA,SAAP,yCAAOA,SAAP,OAAqB,QADnB,IAEF,OAAOC,MAAP,KAAkB,UAFhB,IAGF,QAAOA,MAAP,yCAAOA,MAAP,OAAkB,QAHpB,EAG8B;AAC5B,WAAO;AACL,SAAG;AADE,KAAP;AAGD;AACD,MAAID,cAAc,IAAlB,EAAwB;AACtBA,gBAAY,GAAZ;AACD;;AAED;AACAA,eAAa,EAAb;AACAC,YAAU,EAAV;;AAEA,MAAII,IAAIJ,OAAOK,KAAP,CAAaN,SAAb,CAAR;;AAEA,MAAI,OAAOE,KAAP,KAAiB,WAArB,EAAkC,OAAOG,CAAP;;AAElC;AACA,MAAIH,UAAU,CAAd,EAAiBA,QAAQ,CAAR;;AAEjB;AACA,MAAIA,QAAQ,CAAZ,EAAe;AACb,QAAIA,SAASG,EAAED,MAAf,EAAuB;AACrB,aAAOC,CAAP;AACD;AACD,WAAOA,EACJE,KADI,CACE,CADF,EACKL,QAAQ,CADb,EAEJM,MAFI,CAEG,CAACH,EAAEE,KAAF,CAAQL,QAAQ,CAAhB,EACNO,IADM,CACDT,SADC,CAAD,CAFH,CAAP;AAKD;;AAED;AACA,MAAI,CAACE,KAAD,IAAUG,EAAED,MAAhB,EAAwB;AACtB,WAAO,EAAP;AACD;;AAEDC,IAAEK,MAAF,CAASL,EAAED,MAAF,GAAWF,KAApB;AACA,SAAOG,CAAP;AACD,CA1DD","file":"explode.js","sourcesContent":["module.exports = function explode (delimiter, string, limit) {\n // discuss at: http://locutus.io/php/explode/\n // original by: Kevin van Zonneveld (http://kvz.io)\n // example 1: explode(' ', 'Kevin van Zonneveld')\n // returns 1: [ 'Kevin', 'van', 'Zonneveld' ]\n\n if (arguments.length < 2 ||\n typeof delimiter === 'undefined' ||\n typeof string === 'undefined') {\n return null\n }\n if (delimiter === '' ||\n delimiter === false ||\n delimiter === null) {\n return false\n }\n if (typeof delimiter === 'function' ||\n typeof delimiter === 'object' ||\n typeof string === 'function' ||\n typeof string === 'object') {\n return {\n 0: ''\n }\n }\n if (delimiter === true) {\n delimiter = '1'\n }\n\n // Here we go...\n delimiter += ''\n string += ''\n\n var s = string.split(delimiter)\n\n if (typeof limit === 'undefined') return s\n\n // Support for limit\n if (limit === 0) limit = 1\n\n // Positive limit\n if (limit > 0) {\n if (limit >= s.length) {\n return s\n }\n return s\n .slice(0, limit - 1)\n .concat([s.slice(limit - 1)\n .join(delimiter)\n ])\n }\n\n // Negative limit\n if (-limit >= s.length) {\n return []\n }\n\n s.splice(s.length + limit)\n return s\n}\n"]}
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/get_html_translation_table.js b/node_modules/locutus/php/strings/get_html_translation_table.js new file mode 100644 index 0000000..9b5bbe6 --- /dev/null +++ b/node_modules/locutus/php/strings/get_html_translation_table.js @@ -0,0 +1,166 @@ +'use strict'; + +module.exports = function get_html_translation_table(table, quoteStyle) { + // eslint-disable-line camelcase + // discuss at: http://locutus.io/php/get_html_translation_table/ + // original by: Philip Peterson + // revised by: Kevin van Zonneveld (http://kvz.io) + // bugfixed by: noname + // bugfixed by: Alex + // bugfixed by: Marco + // bugfixed by: madipta + // bugfixed by: Brett Zamir (http://brett-zamir.me) + // bugfixed by: T.Wild + // improved by: KELAN + // improved by: Brett Zamir (http://brett-zamir.me) + // input by: Frank Forte + // input by: Ratheous + // note 1: It has been decided that we're not going to add global + // note 1: dependencies to Locutus, meaning the constants are not + // note 1: real constants, but strings instead. Integers are also supported if someone + // note 1: chooses to create the constants themselves. + // example 1: get_html_translation_table('HTML_SPECIALCHARS') + // returns 1: {'"': '"', '&': '&', '<': '<', '>': '>'} + + var entities = {}; + var hashMap = {}; + var decimal; + var constMappingTable = {}; + var constMappingQuoteStyle = {}; + var useTable = {}; + var useQuoteStyle = {}; + + // Translate arguments + constMappingTable[0] = 'HTML_SPECIALCHARS'; + constMappingTable[1] = 'HTML_ENTITIES'; + constMappingQuoteStyle[0] = 'ENT_NOQUOTES'; + constMappingQuoteStyle[2] = 'ENT_COMPAT'; + constMappingQuoteStyle[3] = 'ENT_QUOTES'; + + useTable = !isNaN(table) ? constMappingTable[table] : table ? table.toUpperCase() : 'HTML_SPECIALCHARS'; + + useQuoteStyle = !isNaN(quoteStyle) ? constMappingQuoteStyle[quoteStyle] : quoteStyle ? quoteStyle.toUpperCase() : 'ENT_COMPAT'; + + if (useTable !== 'HTML_SPECIALCHARS' && useTable !== 'HTML_ENTITIES') { + throw new Error('Table: ' + useTable + ' not supported'); + } + + entities['38'] = '&'; + if (useTable === 'HTML_ENTITIES') { + entities['160'] = ' '; + entities['161'] = '¡'; + entities['162'] = '¢'; + entities['163'] = '£'; + entities['164'] = '¤'; + entities['165'] = '¥'; + entities['166'] = '¦'; + entities['167'] = '§'; + entities['168'] = '¨'; + entities['169'] = '©'; + entities['170'] = 'ª'; + entities['171'] = '«'; + entities['172'] = '¬'; + entities['173'] = '­'; + entities['174'] = '®'; + entities['175'] = '¯'; + entities['176'] = '°'; + entities['177'] = '±'; + entities['178'] = '²'; + entities['179'] = '³'; + entities['180'] = '´'; + entities['181'] = 'µ'; + entities['182'] = '¶'; + entities['183'] = '·'; + entities['184'] = '¸'; + entities['185'] = '¹'; + entities['186'] = 'º'; + entities['187'] = '»'; + entities['188'] = '¼'; + entities['189'] = '½'; + entities['190'] = '¾'; + entities['191'] = '¿'; + entities['192'] = 'À'; + entities['193'] = 'Á'; + entities['194'] = 'Â'; + entities['195'] = 'Ã'; + entities['196'] = 'Ä'; + entities['197'] = 'Å'; + entities['198'] = 'Æ'; + entities['199'] = 'Ç'; + entities['200'] = 'È'; + entities['201'] = 'É'; + entities['202'] = 'Ê'; + entities['203'] = 'Ë'; + entities['204'] = 'Ì'; + entities['205'] = 'Í'; + entities['206'] = 'Î'; + entities['207'] = 'Ï'; + entities['208'] = 'Ð'; + entities['209'] = 'Ñ'; + entities['210'] = 'Ò'; + entities['211'] = 'Ó'; + entities['212'] = 'Ô'; + entities['213'] = 'Õ'; + entities['214'] = 'Ö'; + entities['215'] = '×'; + entities['216'] = 'Ø'; + entities['217'] = 'Ù'; + entities['218'] = 'Ú'; + entities['219'] = 'Û'; + entities['220'] = 'Ü'; + entities['221'] = 'Ý'; + entities['222'] = 'Þ'; + entities['223'] = 'ß'; + entities['224'] = 'à'; + entities['225'] = 'á'; + entities['226'] = 'â'; + entities['227'] = 'ã'; + entities['228'] = 'ä'; + entities['229'] = 'å'; + entities['230'] = 'æ'; + entities['231'] = 'ç'; + entities['232'] = 'è'; + entities['233'] = 'é'; + entities['234'] = 'ê'; + entities['235'] = 'ë'; + entities['236'] = 'ì'; + entities['237'] = 'í'; + entities['238'] = 'î'; + entities['239'] = 'ï'; + entities['240'] = 'ð'; + entities['241'] = 'ñ'; + entities['242'] = 'ò'; + entities['243'] = 'ó'; + entities['244'] = 'ô'; + entities['245'] = 'õ'; + entities['246'] = 'ö'; + entities['247'] = '÷'; + entities['248'] = 'ø'; + entities['249'] = 'ù'; + entities['250'] = 'ú'; + entities['251'] = 'û'; + entities['252'] = 'ü'; + entities['253'] = 'ý'; + entities['254'] = 'þ'; + entities['255'] = 'ÿ'; + } + + if (useQuoteStyle !== 'ENT_NOQUOTES') { + entities['34'] = '"'; + } + if (useQuoteStyle === 'ENT_QUOTES') { + entities['39'] = '''; + } + entities['60'] = '<'; + entities['62'] = '>'; + + // ascii decimals to real symbols + for (decimal in entities) { + if (entities.hasOwnProperty(decimal)) { + hashMap[String.fromCharCode(decimal)] = entities[decimal]; + } + } + + return hashMap; +}; +//# sourceMappingURL=get_html_translation_table.js.map
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/get_html_translation_table.js.map b/node_modules/locutus/php/strings/get_html_translation_table.js.map new file mode 100644 index 0000000..01c0a7a --- /dev/null +++ b/node_modules/locutus/php/strings/get_html_translation_table.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/php/strings/get_html_translation_table.js"],"names":["module","exports","get_html_translation_table","table","quoteStyle","entities","hashMap","decimal","constMappingTable","constMappingQuoteStyle","useTable","useQuoteStyle","isNaN","toUpperCase","Error","hasOwnProperty","String","fromCharCode"],"mappings":";;AAAAA,OAAOC,OAAP,GAAiB,SAASC,0BAAT,CAAqCC,KAArC,EAA4CC,UAA5C,EAAwD;AAAE;AACzE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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A,aAAS,KAAT,IAAkB,UAAlB;AACAA,aAAS,KAAT,IAAkB,UAAlB;AACAA,aAAS,KAAT,IAAkB,SAAlB;AACAA,aAAS,KAAT,IAAkB,QAAlB;AACAA,aAAS,KAAT,IAAkB,UAAlB;AACAA,aAAS,KAAT,IAAkB,SAAlB;AACAA,aAAS,KAAT,IAAkB,QAAlB;AACD;;AAED,MAAIM,kBAAkB,cAAtB,EAAsC;AACpCN,aAAS,IAAT,IAAiB,QAAjB;AACD;AACD,MAAIM,kBAAkB,YAAtB,EAAoC;AAClCN,aAAS,IAAT,IAAiB,OAAjB;AACD;AACDA,WAAS,IAAT,IAAiB,MAAjB;AACAA,WAAS,IAAT,IAAiB,MAAjB;;AAEA;AACA,OAAKE,OAAL,IAAgBF,QAAhB,EAA0B;AACxB,QAAIA,SAASU,cAAT,CAAwBR,OAAxB,CAAJ,EAAsC;AACpCD,cAAQU,OAAOC,YAAP,CAAoBV,OAApB,CAAR,IAAwCF,SAASE,OAAT,CAAxC;AACD;AACF;;AAED,SAAOD,OAAP;AACD,CAzKD","file":"get_html_translation_table.js","sourcesContent":["module.exports = function get_html_translation_table (table, quoteStyle) { // eslint-disable-line camelcase\n // discuss at: http://locutus.io/php/get_html_translation_table/\n // original by: Philip Peterson\n // revised by: Kevin van Zonneveld (http://kvz.io)\n // bugfixed by: noname\n // bugfixed by: Alex\n // bugfixed by: Marco\n // bugfixed by: madipta\n // bugfixed by: Brett Zamir (http://brett-zamir.me)\n // bugfixed by: T.Wild\n // improved by: KELAN\n // improved by: Brett Zamir (http://brett-zamir.me)\n // input by: Frank Forte\n // input by: Ratheous\n // note 1: It has been decided that we're not going to add global\n // note 1: dependencies to Locutus, meaning the constants are not\n // note 1: real constants, but strings instead. Integers are also supported if someone\n // note 1: chooses to create the constants themselves.\n // example 1: get_html_translation_table('HTML_SPECIALCHARS')\n // returns 1: {'\"': '"', '&': '&', '<': '<', '>': '>'}\n\n var entities = {}\n var hashMap = {}\n var decimal\n var constMappingTable = {}\n var constMappingQuoteStyle = {}\n var useTable = {}\n var useQuoteStyle = {}\n\n // Translate arguments\n constMappingTable[0] = 'HTML_SPECIALCHARS'\n constMappingTable[1] = 'HTML_ENTITIES'\n constMappingQuoteStyle[0] = 'ENT_NOQUOTES'\n constMappingQuoteStyle[2] = 'ENT_COMPAT'\n constMappingQuoteStyle[3] = 'ENT_QUOTES'\n\n useTable = !isNaN(table)\n ? constMappingTable[table]\n : table\n ? table.toUpperCase()\n : 'HTML_SPECIALCHARS'\n\n useQuoteStyle = !isNaN(quoteStyle)\n ? constMappingQuoteStyle[quoteStyle]\n : quoteStyle\n ? quoteStyle.toUpperCase()\n : 'ENT_COMPAT'\n\n if (useTable !== 'HTML_SPECIALCHARS' && useTable !== 'HTML_ENTITIES') {\n throw new Error('Table: ' + useTable + ' not supported')\n }\n\n entities['38'] = '&'\n if (useTable === 'HTML_ENTITIES') {\n entities['160'] = ' '\n entities['161'] = '¡'\n entities['162'] = '¢'\n entities['163'] = '£'\n entities['164'] = '¤'\n entities['165'] = '¥'\n entities['166'] = '¦'\n entities['167'] = '§'\n entities['168'] = '¨'\n entities['169'] = '©'\n entities['170'] = 'ª'\n entities['171'] = '«'\n entities['172'] = '¬'\n entities['173'] = '­'\n entities['174'] = '®'\n entities['175'] = '¯'\n entities['176'] = '°'\n entities['177'] = '±'\n entities['178'] = '²'\n entities['179'] = '³'\n entities['180'] = '´'\n entities['181'] = 'µ'\n entities['182'] = '¶'\n entities['183'] = '·'\n entities['184'] = '¸'\n entities['185'] = '¹'\n entities['186'] = 'º'\n entities['187'] = '»'\n entities['188'] = '¼'\n entities['189'] = '½'\n entities['190'] = '¾'\n entities['191'] = '¿'\n entities['192'] = 'À'\n entities['193'] = 'Á'\n entities['194'] = 'Â'\n entities['195'] = 'Ã'\n entities['196'] = 'Ä'\n entities['197'] = 'Å'\n entities['198'] = 'Æ'\n entities['199'] = 'Ç'\n entities['200'] = 'È'\n entities['201'] = 'É'\n entities['202'] = 'Ê'\n entities['203'] = 'Ë'\n entities['204'] = 'Ì'\n entities['205'] = 'Í'\n entities['206'] = 'Î'\n entities['207'] = 'Ï'\n entities['208'] = 'Ð'\n entities['209'] = 'Ñ'\n entities['210'] = 'Ò'\n entities['211'] = 'Ó'\n entities['212'] = 'Ô'\n entities['213'] = 'Õ'\n entities['214'] = 'Ö'\n entities['215'] = '×'\n entities['216'] = 'Ø'\n entities['217'] = 'Ù'\n entities['218'] = 'Ú'\n entities['219'] = 'Û'\n entities['220'] = 'Ü'\n entities['221'] = 'Ý'\n entities['222'] = 'Þ'\n entities['223'] = 'ß'\n entities['224'] = 'à'\n entities['225'] = 'á'\n entities['226'] = 'â'\n entities['227'] = 'ã'\n entities['228'] = 'ä'\n entities['229'] = 'å'\n entities['230'] = 'æ'\n entities['231'] = 'ç'\n entities['232'] = 'è'\n entities['233'] = 'é'\n entities['234'] = 'ê'\n entities['235'] = 'ë'\n entities['236'] = 'ì'\n entities['237'] = 'í'\n entities['238'] = 'î'\n entities['239'] = 'ï'\n entities['240'] = 'ð'\n entities['241'] = 'ñ'\n entities['242'] = 'ò'\n entities['243'] = 'ó'\n entities['244'] = 'ô'\n entities['245'] = 'õ'\n entities['246'] = 'ö'\n entities['247'] = '÷'\n entities['248'] = 'ø'\n entities['249'] = 'ù'\n entities['250'] = 'ú'\n entities['251'] = 'û'\n entities['252'] = 'ü'\n entities['253'] = 'ý'\n entities['254'] = 'þ'\n entities['255'] = 'ÿ'\n }\n\n if (useQuoteStyle !== 'ENT_NOQUOTES') {\n entities['34'] = '"'\n }\n if (useQuoteStyle === 'ENT_QUOTES') {\n entities['39'] = '''\n }\n entities['60'] = '<'\n entities['62'] = '>'\n\n // ascii decimals to real symbols\n for (decimal in entities) {\n if (entities.hasOwnProperty(decimal)) {\n hashMap[String.fromCharCode(decimal)] = entities[decimal]\n }\n }\n\n return hashMap\n}\n"]}
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/hex2bin.js b/node_modules/locutus/php/strings/hex2bin.js new file mode 100644 index 0000000..ef0331b --- /dev/null +++ b/node_modules/locutus/php/strings/hex2bin.js @@ -0,0 +1,28 @@ +'use strict'; + +module.exports = function hex2bin(s) { + // discuss at: http://locutus.io/php/hex2bin/ + // original by: Dumitru Uzun (http://duzun.me) + // example 1: hex2bin('44696d61') + // returns 1: 'Dima' + // example 2: hex2bin('00') + // returns 2: '\x00' + // example 3: hex2bin('2f1q') + // returns 3: false + + var ret = []; + var i = 0; + var l; + + s += ''; + + for (l = s.length; i < l; i += 2) { + var c = parseInt(s.substr(i, 1), 16); + var k = parseInt(s.substr(i + 1, 1), 16); + if (isNaN(c) || isNaN(k)) return false; + ret.push(c << 4 | k); + } + + return String.fromCharCode.apply(String, ret); +}; +//# sourceMappingURL=hex2bin.js.map
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/hex2bin.js.map b/node_modules/locutus/php/strings/hex2bin.js.map new file mode 100644 index 0000000..40e66b4 --- /dev/null +++ b/node_modules/locutus/php/strings/hex2bin.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/php/strings/hex2bin.js"],"names":["module","exports","hex2bin","s","ret","i","l","length","c","parseInt","substr","k","isNaN","push","String","fromCharCode","apply"],"mappings":";;AAAAA,OAAOC,OAAP,GAAiB,SAASC,OAAT,CAAkBC,CAAlB,EAAqB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,MAAIC,MAAM,EAAV;AACA,MAAIC,IAAI,CAAR;AACA,MAAIC,CAAJ;;AAEAH,OAAK,EAAL;;AAEA,OAAKG,IAAIH,EAAEI,MAAX,EAAmBF,IAAIC,CAAvB,EAA0BD,KAAK,CAA/B,EAAkC;AAChC,QAAIG,IAAIC,SAASN,EAAEO,MAAF,CAASL,CAAT,EAAY,CAAZ,CAAT,EAAyB,EAAzB,CAAR;AACA,QAAIM,IAAIF,SAASN,EAAEO,MAAF,CAASL,IAAI,CAAb,EAAgB,CAAhB,CAAT,EAA6B,EAA7B,CAAR;AACA,QAAIO,MAAMJ,CAAN,KAAYI,MAAMD,CAAN,CAAhB,EAA0B,OAAO,KAAP;AAC1BP,QAAIS,IAAJ,CAAUL,KAAK,CAAN,GAAWG,CAApB;AACD;;AAED,SAAOG,OAAOC,YAAP,CAAoBC,KAApB,CAA0BF,MAA1B,EAAkCV,GAAlC,CAAP;AACD,CAxBD","file":"hex2bin.js","sourcesContent":["module.exports = function hex2bin (s) {\n // discuss at: http://locutus.io/php/hex2bin/\n // original by: Dumitru Uzun (http://duzun.me)\n // example 1: hex2bin('44696d61')\n // returns 1: 'Dima'\n // example 2: hex2bin('00')\n // returns 2: '\\x00'\n // example 3: hex2bin('2f1q')\n // returns 3: false\n\n var ret = []\n var i = 0\n var l\n\n s += ''\n\n for (l = s.length; i < l; i += 2) {\n var c = parseInt(s.substr(i, 1), 16)\n var k = parseInt(s.substr(i + 1, 1), 16)\n if (isNaN(c) || isNaN(k)) return false\n ret.push((c << 4) | k)\n }\n\n return String.fromCharCode.apply(String, ret)\n}\n"]}
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/html_entity_decode.js b/node_modules/locutus/php/strings/html_entity_decode.js new file mode 100644 index 0000000..f240e21 --- /dev/null +++ b/node_modules/locutus/php/strings/html_entity_decode.js @@ -0,0 +1,46 @@ +'use strict'; + +module.exports = function html_entity_decode(string, quoteStyle) { + // eslint-disable-line camelcase + // discuss at: http://locutus.io/php/html_entity_decode/ + // original by: john (http://www.jd-tech.net) + // input by: ger + // input by: Ratheous + // input by: Nick Kolosov (http://sammy.ru) + // improved by: Kevin van Zonneveld (http://kvz.io) + // improved by: marc andreu + // revised by: Kevin van Zonneveld (http://kvz.io) + // revised by: Kevin van Zonneveld (http://kvz.io) + // bugfixed by: Onno Marsman (https://twitter.com/onnomarsman) + // bugfixed by: Brett Zamir (http://brett-zamir.me) + // bugfixed by: Fox + // example 1: html_entity_decode('Kevin & van Zonneveld') + // returns 1: 'Kevin & van Zonneveld' + // example 2: html_entity_decode('&lt;') + // returns 2: '<' + + var getHtmlTranslationTable = require('../strings/get_html_translation_table'); + var tmpStr = ''; + var entity = ''; + var symbol = ''; + tmpStr = string.toString(); + + var hashMap = getHtmlTranslationTable('HTML_ENTITIES', quoteStyle); + if (hashMap === false) { + return false; + } + + // @todo: & problem + // http://locutus.io/php/get_html_translation_table:416#comment_97660 + delete hashMap['&']; + hashMap['&'] = '&'; + + for (symbol in hashMap) { + entity = hashMap[symbol]; + tmpStr = tmpStr.split(entity).join(symbol); + } + tmpStr = tmpStr.split(''').join("'"); + + return tmpStr; +}; +//# sourceMappingURL=html_entity_decode.js.map
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/html_entity_decode.js.map b/node_modules/locutus/php/strings/html_entity_decode.js.map new file mode 100644 index 0000000..4b00249 --- /dev/null +++ b/node_modules/locutus/php/strings/html_entity_decode.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/php/strings/html_entity_decode.js"],"names":["module","exports","html_entity_decode","string","quoteStyle","getHtmlTranslationTable","require","tmpStr","entity","symbol","toString","hashMap","split","join"],"mappings":";;AAAAA,OAAOC,OAAP,GAAiB,SAASC,kBAAT,CAA6BC,MAA7B,EAAqCC,UAArC,EAAiD;AAAE;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,MAAIC,0BAA0BC,QAAQ,uCAAR,CAA9B;AACA,MAAIC,SAAS,EAAb;AACA,MAAIC,SAAS,EAAb;AACA,MAAIC,SAAS,EAAb;AACAF,WAASJ,OAAOO,QAAP,EAAT;;AAEA,MAAIC,UAAUN,wBAAwB,eAAxB,EAAyCD,UAAzC,CAAd;AACA,MAAIO,YAAY,KAAhB,EAAuB;AACrB,WAAO,KAAP;AACD;;AAED;AACA;AACA,SAAQA,QAAQ,GAAR,CAAR;AACAA,UAAQ,GAAR,IAAe,OAAf;;AAEA,OAAKF,MAAL,IAAeE,OAAf,EAAwB;AACtBH,aAASG,QAAQF,MAAR,CAAT;AACAF,aAASA,OAAOK,KAAP,CAAaJ,MAAb,EAAqBK,IAArB,CAA0BJ,MAA1B,CAAT;AACD;AACDF,WAASA,OAAOK,KAAP,CAAa,QAAb,EAAuBC,IAAvB,CAA4B,GAA5B,CAAT;;AAEA,SAAON,MAAP;AACD,CAzCD","file":"html_entity_decode.js","sourcesContent":["module.exports = function html_entity_decode (string, quoteStyle) { // eslint-disable-line camelcase\n // discuss at: http://locutus.io/php/html_entity_decode/\n // original by: john (http://www.jd-tech.net)\n // input by: ger\n // input by: Ratheous\n // input by: Nick Kolosov (http://sammy.ru)\n // improved by: Kevin van Zonneveld (http://kvz.io)\n // improved by: marc andreu\n // revised by: Kevin van Zonneveld (http://kvz.io)\n // revised by: Kevin van Zonneveld (http://kvz.io)\n // bugfixed by: Onno Marsman (https://twitter.com/onnomarsman)\n // bugfixed by: Brett Zamir (http://brett-zamir.me)\n // bugfixed by: Fox\n // example 1: html_entity_decode('Kevin & van Zonneveld')\n // returns 1: 'Kevin & van Zonneveld'\n // example 2: html_entity_decode('&lt;')\n // returns 2: '<'\n\n var getHtmlTranslationTable = require('../strings/get_html_translation_table')\n var tmpStr = ''\n var entity = ''\n var symbol = ''\n tmpStr = string.toString()\n\n var hashMap = getHtmlTranslationTable('HTML_ENTITIES', quoteStyle)\n if (hashMap === false) {\n return false\n }\n\n // @todo: & problem\n // http://locutus.io/php/get_html_translation_table:416#comment_97660\n delete (hashMap['&'])\n hashMap['&'] = '&'\n\n for (symbol in hashMap) {\n entity = hashMap[symbol]\n tmpStr = tmpStr.split(entity).join(symbol)\n }\n tmpStr = tmpStr.split(''').join(\"'\")\n\n return tmpStr\n}\n"]}
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/htmlentities.js b/node_modules/locutus/php/strings/htmlentities.js new file mode 100644 index 0000000..2cba4e5 --- /dev/null +++ b/node_modules/locutus/php/strings/htmlentities.js @@ -0,0 +1,48 @@ +'use strict'; + +module.exports = function htmlentities(string, quoteStyle, charset, doubleEncode) { + // discuss at: http://locutus.io/php/htmlentities/ + // original by: Kevin van Zonneveld (http://kvz.io) + // revised by: Kevin van Zonneveld (http://kvz.io) + // revised by: Kevin van Zonneveld (http://kvz.io) + // improved by: nobbler + // improved by: Jack + // improved by: Rafał Kukawski (http://blog.kukawski.pl) + // improved by: Dj (http://locutus.io/php/htmlentities:425#comment_134018) + // bugfixed by: Onno Marsman (https://twitter.com/onnomarsman) + // bugfixed by: Brett Zamir (http://brett-zamir.me) + // input by: Ratheous + // note 1: function is compatible with PHP 5.2 and older + // example 1: htmlentities('Kevin & van Zonneveld') + // returns 1: 'Kevin & van Zonneveld' + // example 2: htmlentities("foo'bar","ENT_QUOTES") + // returns 2: 'foo'bar' + + var getHtmlTranslationTable = require('../strings/get_html_translation_table'); + var hashMap = getHtmlTranslationTable('HTML_ENTITIES', quoteStyle); + + string = string === null ? '' : string + ''; + + if (!hashMap) { + return false; + } + + if (quoteStyle && quoteStyle === 'ENT_QUOTES') { + hashMap["'"] = '''; + } + + doubleEncode = doubleEncode === null || !!doubleEncode; + + var regex = new RegExp('&(?:#\\d+|#x[\\da-f]+|[a-zA-Z][\\da-z]*);|[' + Object.keys(hashMap).join('') + // replace regexp special chars + .replace(/([()[\]{}\-.*+?^$|/\\])/g, '\\$1') + ']', 'g'); + + return string.replace(regex, function (ent) { + if (ent.length > 1) { + return doubleEncode ? hashMap['&'] + ent.substr(1) : ent; + } + + return hashMap[ent]; + }); +}; +//# sourceMappingURL=htmlentities.js.map
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/htmlentities.js.map b/node_modules/locutus/php/strings/htmlentities.js.map new file mode 100644 index 0000000..1dc29b8 --- /dev/null +++ b/node_modules/locutus/php/strings/htmlentities.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/php/strings/htmlentities.js"],"names":["module","exports","htmlentities","string","quoteStyle","charset","doubleEncode","getHtmlTranslationTable","require","hashMap","regex","RegExp","Object","keys","join","replace","ent","length","substr"],"mappings":";;AAAAA,OAAOC,OAAP,GAAiB,SAASC,YAAT,CAAuBC,MAAvB,EAA+BC,UAA/B,EAA2CC,OAA3C,EAAoDC,YAApD,EAAkE;AACjF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,MAAIC,0BAA0BC,QAAQ,uCAAR,CAA9B;AACA,MAAIC,UAAUF,wBAAwB,eAAxB,EAAyCH,UAAzC,CAAd;;AAEAD,WAASA,WAAW,IAAX,GAAkB,EAAlB,GAAuBA,SAAS,EAAzC;;AAEA,MAAI,CAACM,OAAL,EAAc;AACZ,WAAO,KAAP;AACD;;AAED,MAAIL,cAAcA,eAAe,YAAjC,EAA+C;AAC7CK,YAAQ,GAAR,IAAe,QAAf;AACD;;AAEDH,iBAAeA,iBAAiB,IAAjB,IAAyB,CAAC,CAACA,YAA1C;;AAEA,MAAII,QAAQ,IAAIC,MAAJ,CAAW,gDACrBC,OAAOC,IAAP,CAAYJ,OAAZ,EACCK,IADD,CACM,EADN;AAEA;AAFA,GAGCC,OAHD,CAGS,0BAHT,EAGqC,MAHrC,CADqB,GAI0B,GAJrC,EAKV,GALU,CAAZ;;AAOA,SAAOZ,OAAOY,OAAP,CAAeL,KAAf,EAAsB,UAAUM,GAAV,EAAe;AAC1C,QAAIA,IAAIC,MAAJ,GAAa,CAAjB,EAAoB;AAClB,aAAOX,eAAeG,QAAQ,GAAR,IAAeO,IAAIE,MAAJ,CAAW,CAAX,CAA9B,GAA8CF,GAArD;AACD;;AAED,WAAOP,QAAQO,GAAR,CAAP;AACD,GANM,CAAP;AAOD,CA/CD","file":"htmlentities.js","sourcesContent":["module.exports = function htmlentities (string, quoteStyle, charset, doubleEncode) {\n // discuss at: http://locutus.io/php/htmlentities/\n // original by: Kevin van Zonneveld (http://kvz.io)\n // revised by: Kevin van Zonneveld (http://kvz.io)\n // revised by: Kevin van Zonneveld (http://kvz.io)\n // improved by: nobbler\n // improved by: Jack\n // improved by: Rafał Kukawski (http://blog.kukawski.pl)\n // improved by: Dj (http://locutus.io/php/htmlentities:425#comment_134018)\n // bugfixed by: Onno Marsman (https://twitter.com/onnomarsman)\n // bugfixed by: Brett Zamir (http://brett-zamir.me)\n // input by: Ratheous\n // note 1: function is compatible with PHP 5.2 and older\n // example 1: htmlentities('Kevin & van Zonneveld')\n // returns 1: 'Kevin & van Zonneveld'\n // example 2: htmlentities(\"foo'bar\",\"ENT_QUOTES\")\n // returns 2: 'foo'bar'\n\n var getHtmlTranslationTable = require('../strings/get_html_translation_table')\n var hashMap = getHtmlTranslationTable('HTML_ENTITIES', quoteStyle)\n\n string = string === null ? '' : string + ''\n\n if (!hashMap) {\n return false\n }\n\n if (quoteStyle && quoteStyle === 'ENT_QUOTES') {\n hashMap[\"'\"] = '''\n }\n\n doubleEncode = doubleEncode === null || !!doubleEncode\n\n var regex = new RegExp('&(?:#\\\\d+|#x[\\\\da-f]+|[a-zA-Z][\\\\da-z]*);|[' +\n Object.keys(hashMap)\n .join('')\n // replace regexp special chars\n .replace(/([()[\\]{}\\-.*+?^$|/\\\\])/g, '\\\\$1') + ']',\n 'g')\n\n return string.replace(regex, function (ent) {\n if (ent.length > 1) {\n return doubleEncode ? hashMap['&'] + ent.substr(1) : ent\n }\n\n return hashMap[ent]\n })\n}\n"]}
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/htmlspecialchars.js b/node_modules/locutus/php/strings/htmlspecialchars.js new file mode 100644 index 0000000..d19950c --- /dev/null +++ b/node_modules/locutus/php/strings/htmlspecialchars.js @@ -0,0 +1,73 @@ +'use strict'; + +module.exports = function htmlspecialchars(string, quoteStyle, charset, doubleEncode) { + // discuss at: http://locutus.io/php/htmlspecialchars/ + // original by: Mirek Slugen + // improved by: Kevin van Zonneveld (http://kvz.io) + // bugfixed by: Nathan + // bugfixed by: Arno + // bugfixed by: Brett Zamir (http://brett-zamir.me) + // bugfixed by: Brett Zamir (http://brett-zamir.me) + // revised by: Kevin van Zonneveld (http://kvz.io) + // input by: Ratheous + // input by: Mailfaker (http://www.weedem.fr/) + // input by: felix + // reimplemented by: Brett Zamir (http://brett-zamir.me) + // note 1: charset argument not supported + // example 1: htmlspecialchars("<a href='test'>Test</a>", 'ENT_QUOTES') + // returns 1: '<a href='test'>Test</a>' + // example 2: htmlspecialchars("ab\"c'd", ['ENT_NOQUOTES', 'ENT_QUOTES']) + // returns 2: 'ab"c'd' + // example 3: htmlspecialchars('my "&entity;" is still here', null, null, false) + // returns 3: 'my "&entity;" is still here' + + var optTemp = 0; + var i = 0; + var noquotes = false; + if (typeof quoteStyle === 'undefined' || quoteStyle === null) { + quoteStyle = 2; + } + string = string || ''; + string = string.toString(); + + if (doubleEncode !== false) { + // Put this first to avoid double-encoding + string = string.replace(/&/g, '&'); + } + + string = string.replace(/</g, '<').replace(/>/g, '>'); + + var OPTS = { + 'ENT_NOQUOTES': 0, + 'ENT_HTML_QUOTE_SINGLE': 1, + 'ENT_HTML_QUOTE_DOUBLE': 2, + 'ENT_COMPAT': 2, + 'ENT_QUOTES': 3, + 'ENT_IGNORE': 4 + }; + if (quoteStyle === 0) { + noquotes = true; + } + if (typeof quoteStyle !== 'number') { + // Allow for a single string or an array of string flags + quoteStyle = [].concat(quoteStyle); + for (i = 0; i < quoteStyle.length; i++) { + // Resolve string input to bitwise e.g. 'ENT_IGNORE' becomes 4 + if (OPTS[quoteStyle[i]] === 0) { + noquotes = true; + } else if (OPTS[quoteStyle[i]]) { + optTemp = optTemp | OPTS[quoteStyle[i]]; + } + } + quoteStyle = optTemp; + } + if (quoteStyle & OPTS.ENT_HTML_QUOTE_SINGLE) { + string = string.replace(/'/g, '''); + } + if (!noquotes) { + string = string.replace(/"/g, '"'); + } + + return string; +}; +//# sourceMappingURL=htmlspecialchars.js.map
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/htmlspecialchars.js.map b/node_modules/locutus/php/strings/htmlspecialchars.js.map new file mode 100644 index 0000000..f34757b --- /dev/null +++ b/node_modules/locutus/php/strings/htmlspecialchars.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/php/strings/htmlspecialchars.js"],"names":["module","exports","htmlspecialchars","string","quoteStyle","charset","doubleEncode","optTemp","i","noquotes","toString","replace","OPTS","concat","length","ENT_HTML_QUOTE_SINGLE"],"mappings":";;AAAAA,OAAOC,OAAP,GAAiB,SAASC,gBAAT,CAA2BC,MAA3B,EAAmCC,UAAnC,EAA+CC,OAA/C,EAAwDC,YAAxD,EAAsE;AACrF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,MAAIC,UAAU,CAAd;AACA,MAAIC,IAAI,CAAR;AACA,MAAIC,WAAW,KAAf;AACA,MAAI,OAAOL,UAAP,KAAsB,WAAtB,IAAqCA,eAAe,IAAxD,EAA8D;AAC5DA,iBAAa,CAAb;AACD;AACDD,WAASA,UAAU,EAAnB;AACAA,WAASA,OAAOO,QAAP,EAAT;;AAEA,MAAIJ,iBAAiB,KAArB,EAA4B;AAC1B;AACAH,aAASA,OAAOQ,OAAP,CAAe,IAAf,EAAqB,OAArB,CAAT;AACD;;AAEDR,WAASA,OACNQ,OADM,CACE,IADF,EACQ,MADR,EAENA,OAFM,CAEE,IAFF,EAEQ,MAFR,CAAT;;AAIA,MAAIC,OAAO;AACT,oBAAgB,CADP;AAET,6BAAyB,CAFhB;AAGT,6BAAyB,CAHhB;AAIT,kBAAc,CAJL;AAKT,kBAAc,CALL;AAMT,kBAAc;AANL,GAAX;AAQA,MAAIR,eAAe,CAAnB,EAAsB;AACpBK,eAAW,IAAX;AACD;AACD,MAAI,OAAOL,UAAP,KAAsB,QAA1B,EAAoC;AAClC;AACAA,iBAAa,GAAGS,MAAH,CAAUT,UAAV,CAAb;AACA,SAAKI,IAAI,CAAT,EAAYA,IAAIJ,WAAWU,MAA3B,EAAmCN,GAAnC,EAAwC;AACtC;AACA,UAAII,KAAKR,WAAWI,CAAX,CAAL,MAAwB,CAA5B,EAA+B;AAC7BC,mBAAW,IAAX;AACD,OAFD,MAEO,IAAIG,KAAKR,WAAWI,CAAX,CAAL,CAAJ,EAAyB;AAC9BD,kBAAUA,UAAUK,KAAKR,WAAWI,CAAX,CAAL,CAApB;AACD;AACF;AACDJ,iBAAaG,OAAb;AACD;AACD,MAAIH,aAAaQ,KAAKG,qBAAtB,EAA6C;AAC3CZ,aAASA,OAAOQ,OAAP,CAAe,IAAf,EAAqB,QAArB,CAAT;AACD;AACD,MAAI,CAACF,QAAL,EAAe;AACbN,aAASA,OAAOQ,OAAP,CAAe,IAAf,EAAqB,QAArB,CAAT;AACD;;AAED,SAAOR,MAAP;AACD,CAvED","file":"htmlspecialchars.js","sourcesContent":["module.exports = function htmlspecialchars (string, quoteStyle, charset, doubleEncode) {\n // discuss at: http://locutus.io/php/htmlspecialchars/\n // original by: Mirek Slugen\n // improved by: Kevin van Zonneveld (http://kvz.io)\n // bugfixed by: Nathan\n // bugfixed by: Arno\n // bugfixed by: Brett Zamir (http://brett-zamir.me)\n // bugfixed by: Brett Zamir (http://brett-zamir.me)\n // revised by: Kevin van Zonneveld (http://kvz.io)\n // input by: Ratheous\n // input by: Mailfaker (http://www.weedem.fr/)\n // input by: felix\n // reimplemented by: Brett Zamir (http://brett-zamir.me)\n // note 1: charset argument not supported\n // example 1: htmlspecialchars(\"<a href='test'>Test</a>\", 'ENT_QUOTES')\n // returns 1: '<a href='test'>Test</a>'\n // example 2: htmlspecialchars(\"ab\\\"c'd\", ['ENT_NOQUOTES', 'ENT_QUOTES'])\n // returns 2: 'ab\"c'd'\n // example 3: htmlspecialchars('my \"&entity;\" is still here', null, null, false)\n // returns 3: 'my "&entity;" is still here'\n\n var optTemp = 0\n var i = 0\n var noquotes = false\n if (typeof quoteStyle === 'undefined' || quoteStyle === null) {\n quoteStyle = 2\n }\n string = string || ''\n string = string.toString()\n\n if (doubleEncode !== false) {\n // Put this first to avoid double-encoding\n string = string.replace(/&/g, '&')\n }\n\n string = string\n .replace(/</g, '<')\n .replace(/>/g, '>')\n\n var OPTS = {\n 'ENT_NOQUOTES': 0,\n 'ENT_HTML_QUOTE_SINGLE': 1,\n 'ENT_HTML_QUOTE_DOUBLE': 2,\n 'ENT_COMPAT': 2,\n 'ENT_QUOTES': 3,\n 'ENT_IGNORE': 4\n }\n if (quoteStyle === 0) {\n noquotes = true\n }\n if (typeof quoteStyle !== 'number') {\n // Allow for a single string or an array of string flags\n quoteStyle = [].concat(quoteStyle)\n for (i = 0; i < quoteStyle.length; i++) {\n // Resolve string input to bitwise e.g. 'ENT_IGNORE' becomes 4\n if (OPTS[quoteStyle[i]] === 0) {\n noquotes = true\n } else if (OPTS[quoteStyle[i]]) {\n optTemp = optTemp | OPTS[quoteStyle[i]]\n }\n }\n quoteStyle = optTemp\n }\n if (quoteStyle & OPTS.ENT_HTML_QUOTE_SINGLE) {\n string = string.replace(/'/g, ''')\n }\n if (!noquotes) {\n string = string.replace(/\"/g, '"')\n }\n\n return string\n}\n"]}
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/htmlspecialchars_decode.js b/node_modules/locutus/php/strings/htmlspecialchars_decode.js new file mode 100644 index 0000000..5609951 --- /dev/null +++ b/node_modules/locutus/php/strings/htmlspecialchars_decode.js @@ -0,0 +1,71 @@ +'use strict'; + +module.exports = function htmlspecialchars_decode(string, quoteStyle) { + // eslint-disable-line camelcase + // discuss at: http://locutus.io/php/htmlspecialchars_decode/ + // original by: Mirek Slugen + // improved by: Kevin van Zonneveld (http://kvz.io) + // bugfixed by: Mateusz "loonquawl" Zalega + // bugfixed by: Onno Marsman (https://twitter.com/onnomarsman) + // bugfixed by: Brett Zamir (http://brett-zamir.me) + // bugfixed by: Brett Zamir (http://brett-zamir.me) + // input by: ReverseSyntax + // input by: Slawomir Kaniecki + // input by: Scott Cariss + // input by: Francois + // input by: Ratheous + // input by: Mailfaker (http://www.weedem.fr/) + // revised by: Kevin van Zonneveld (http://kvz.io) + // reimplemented by: Brett Zamir (http://brett-zamir.me) + // example 1: htmlspecialchars_decode("<p>this -> "</p>", 'ENT_NOQUOTES') + // returns 1: '<p>this -> "</p>' + // example 2: htmlspecialchars_decode("&quot;") + // returns 2: '"' + + var optTemp = 0; + var i = 0; + var noquotes = false; + + if (typeof quoteStyle === 'undefined') { + quoteStyle = 2; + } + string = string.toString().replace(/</g, '<').replace(/>/g, '>'); + var OPTS = { + 'ENT_NOQUOTES': 0, + 'ENT_HTML_QUOTE_SINGLE': 1, + 'ENT_HTML_QUOTE_DOUBLE': 2, + 'ENT_COMPAT': 2, + 'ENT_QUOTES': 3, + 'ENT_IGNORE': 4 + }; + if (quoteStyle === 0) { + noquotes = true; + } + if (typeof quoteStyle !== 'number') { + // Allow for a single string or an array of string flags + quoteStyle = [].concat(quoteStyle); + for (i = 0; i < quoteStyle.length; i++) { + // Resolve string input to bitwise e.g. 'PATHINFO_EXTENSION' becomes 4 + if (OPTS[quoteStyle[i]] === 0) { + noquotes = true; + } else if (OPTS[quoteStyle[i]]) { + optTemp = optTemp | OPTS[quoteStyle[i]]; + } + } + quoteStyle = optTemp; + } + if (quoteStyle & OPTS.ENT_HTML_QUOTE_SINGLE) { + // PHP doesn't currently escape if more than one 0, but it should: + string = string.replace(/�*39;/g, "'"); + // This would also be useful here, but not a part of PHP: + // string = string.replace(/'|�*27;/g, "'"); + } + if (!noquotes) { + string = string.replace(/"/g, '"'); + } + // Put this in last place to avoid escape being double-decoded + string = string.replace(/&/g, '&'); + + return string; +}; +//# sourceMappingURL=htmlspecialchars_decode.js.map
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/htmlspecialchars_decode.js.map b/node_modules/locutus/php/strings/htmlspecialchars_decode.js.map new file mode 100644 index 0000000..d2f38de --- /dev/null +++ b/node_modules/locutus/php/strings/htmlspecialchars_decode.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/php/strings/htmlspecialchars_decode.js"],"names":["module","exports","htmlspecialchars_decode","string","quoteStyle","optTemp","i","noquotes","toString","replace","OPTS","concat","length","ENT_HTML_QU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AAP,CAAe,SAAf,EAA0B,GAA1B,CAAT;AACD;AACD;AACAN,WAASA,OAAOM,OAAP,CAAe,QAAf,EAAyB,GAAzB,CAAT;;AAEA,SAAON,MAAP;AACD,CApED","file":"htmlspecialchars_decode.js","sourcesContent":["module.exports = function htmlspecialchars_decode (string, quoteStyle) { // eslint-disable-line camelcase\n // discuss at: http://locutus.io/php/htmlspecialchars_decode/\n // original by: Mirek Slugen\n // improved by: Kevin van Zonneveld (http://kvz.io)\n // bugfixed by: Mateusz \"loonquawl\" Zalega\n // bugfixed by: Onno Marsman (https://twitter.com/onnomarsman)\n // bugfixed by: Brett Zamir (http://brett-zamir.me)\n // bugfixed by: Brett Zamir (http://brett-zamir.me)\n // input by: ReverseSyntax\n // input by: Slawomir Kaniecki\n // input by: Scott Cariss\n // input by: Francois\n // input by: Ratheous\n // input by: Mailfaker (http://www.weedem.fr/)\n // revised by: Kevin van Zonneveld (http://kvz.io)\n // reimplemented by: Brett Zamir (http://brett-zamir.me)\n // example 1: htmlspecialchars_decode(\"<p>this -> "</p>\", 'ENT_NOQUOTES')\n // returns 1: '<p>this -> "</p>'\n // example 2: htmlspecialchars_decode(\"&quot;\")\n // returns 2: '"'\n\n var optTemp = 0\n var i = 0\n var noquotes = false\n\n if (typeof quoteStyle === 'undefined') {\n quoteStyle = 2\n }\n string = string.toString()\n .replace(/</g, '<')\n .replace(/>/g, '>')\n var OPTS = {\n 'ENT_NOQUOTES': 0,\n 'ENT_HTML_QUOTE_SINGLE': 1,\n 'ENT_HTML_QUOTE_DOUBLE': 2,\n 'ENT_COMPAT': 2,\n 'ENT_QUOTES': 3,\n 'ENT_IGNORE': 4\n }\n if (quoteStyle === 0) {\n noquotes = true\n }\n if (typeof quoteStyle !== 'number') {\n // Allow for a single string or an array of string flags\n quoteStyle = [].concat(quoteStyle)\n for (i = 0; i < quoteStyle.length; i++) {\n // Resolve string input to bitwise e.g. 'PATHINFO_EXTENSION' becomes 4\n if (OPTS[quoteStyle[i]] === 0) {\n noquotes = true\n } else if (OPTS[quoteStyle[i]]) {\n optTemp = optTemp | OPTS[quoteStyle[i]]\n }\n }\n quoteStyle = optTemp\n }\n if (quoteStyle & OPTS.ENT_HTML_QUOTE_SINGLE) {\n // PHP doesn't currently escape if more than one 0, but it should:\n string = string.replace(/�*39;/g, \"'\")\n // This would also be useful here, but not a part of PHP:\n // string = string.replace(/'|�*27;/g, \"'\");\n }\n if (!noquotes) {\n string = string.replace(/"/g, '\"')\n }\n // Put this in last place to avoid escape being double-decoded\n string = string.replace(/&/g, '&')\n\n return string\n}\n"]}
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/implode.js b/node_modules/locutus/php/strings/implode.js new file mode 100644 index 0000000..3bbcae3 --- /dev/null +++ b/node_modules/locutus/php/strings/implode.js @@ -0,0 +1,38 @@ +'use strict'; + +var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; + +module.exports = function implode(glue, pieces) { + // discuss at: http://locutus.io/php/implode/ + // original by: Kevin van Zonneveld (http://kvz.io) + // improved by: Waldo Malqui Silva (http://waldo.malqui.info) + // improved by: Itsacon (http://www.itsacon.net/) + // bugfixed by: Brett Zamir (http://brett-zamir.me) + // example 1: implode(' ', ['Kevin', 'van', 'Zonneveld']) + // returns 1: 'Kevin van Zonneveld' + // example 2: implode(' ', {first:'Kevin', last: 'van Zonneveld'}) + // returns 2: 'Kevin van Zonneveld' + + var i = ''; + var retVal = ''; + var tGlue = ''; + + if (arguments.length === 1) { + pieces = glue; + glue = ''; + } + + if ((typeof pieces === 'undefined' ? 'undefined' : _typeof(pieces)) === 'object') { + if (Object.prototype.toString.call(pieces) === '[object Array]') { + return pieces.join(glue); + } + for (i in pieces) { + retVal += tGlue + pieces[i]; + tGlue = glue; + } + return retVal; + } + + return pieces; +}; +//# sourceMappingURL=implode.js.map
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/implode.js.map b/node_modules/locutus/php/strings/implode.js.map new file mode 100644 index 0000000..9e0b68f --- /dev/null +++ b/node_modules/locutus/php/strings/implode.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/php/strings/implode.js"],"names":["module","exports","implode","glue","pieces","i","retVal","tGlue","arguments","length","Object","prototype","toString","call","join"],"mappings":";;;;AAAAA,OAAOC,OAAP,GAAiB,SAASC,OAAT,CAAkBC,IAAlB,EAAwBC,MAAxB,EAAgC;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,MAAIC,IAAI,EAAR;AACA,MAAIC,SAAS,EAAb;AACA,MAAIC,QAAQ,EAAZ;;AAEA,MAAIC,UAAUC,MAAV,KAAqB,CAAzB,EAA4B;AAC1BL,aAASD,IAAT;AACAA,WAAO,EAAP;AACD;;AAED,MAAI,QAAOC,MAAP,yCAAOA,MAAP,OAAkB,QAAtB,EAAgC;AAC9B,QAAIM,OAAOC,SAAP,CAAiBC,QAAjB,CAA0BC,IAA1B,CAA+BT,MAA/B,MAA2C,gBAA/C,EAAiE;AAC/D,aAAOA,OAAOU,IAAP,CAAYX,IAAZ,CAAP;AACD;AACD,SAAKE,CAAL,IAAUD,MAAV,EAAkB;AAChBE,gBAAUC,QAAQH,OAAOC,CAAP,CAAlB;AACAE,cAAQJ,IAAR;AACD;AACD,WAAOG,MAAP;AACD;;AAED,SAAOF,MAAP;AACD,CAhCD","file":"implode.js","sourcesContent":["module.exports = function implode (glue, pieces) {\n // discuss at: http://locutus.io/php/implode/\n // original by: Kevin van Zonneveld (http://kvz.io)\n // improved by: Waldo Malqui Silva (http://waldo.malqui.info)\n // improved by: Itsacon (http://www.itsacon.net/)\n // bugfixed by: Brett Zamir (http://brett-zamir.me)\n // example 1: implode(' ', ['Kevin', 'van', 'Zonneveld'])\n // returns 1: 'Kevin van Zonneveld'\n // example 2: implode(' ', {first:'Kevin', last: 'van Zonneveld'})\n // returns 2: 'Kevin van Zonneveld'\n\n var i = ''\n var retVal = ''\n var tGlue = ''\n\n if (arguments.length === 1) {\n pieces = glue\n glue = ''\n }\n\n if (typeof pieces === 'object') {\n if (Object.prototype.toString.call(pieces) === '[object Array]') {\n return pieces.join(glue)\n }\n for (i in pieces) {\n retVal += tGlue + pieces[i]\n tGlue = glue\n }\n return retVal\n }\n\n return pieces\n}\n"]}
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/index.js b/node_modules/locutus/php/strings/index.js new file mode 100644 index 0000000..c0c1a98 --- /dev/null +++ b/node_modules/locutus/php/strings/index.js @@ -0,0 +1,94 @@ +'use strict'; + +module.exports['addcslashes'] = require('./addcslashes'); +module.exports['addslashes'] = require('./addslashes'); +module.exports['bin2hex'] = require('./bin2hex'); +module.exports['chop'] = require('./chop'); +module.exports['chr'] = require('./chr'); +module.exports['chunk_split'] = require('./chunk_split'); +module.exports['convert_cyr_string'] = require('./convert_cyr_string'); +module.exports['convert_uuencode'] = require('./convert_uuencode'); +module.exports['count_chars'] = require('./count_chars'); +module.exports['crc32'] = require('./crc32'); +module.exports['echo'] = require('./echo'); +module.exports['explode'] = require('./explode'); +module.exports['get_html_translation_table'] = require('./get_html_translation_table'); +module.exports['hex2bin'] = require('./hex2bin'); +module.exports['html_entity_decode'] = require('./html_entity_decode'); +module.exports['htmlentities'] = require('./htmlentities'); +module.exports['htmlspecialchars'] = require('./htmlspecialchars'); +module.exports['htmlspecialchars_decode'] = require('./htmlspecialchars_decode'); +module.exports['implode'] = require('./implode'); +module.exports['join'] = require('./join'); +module.exports['lcfirst'] = require('./lcfirst'); +module.exports['levenshtein'] = require('./levenshtein'); +module.exports['localeconv'] = require('./localeconv'); +module.exports['ltrim'] = require('./ltrim'); +module.exports['md5'] = require('./md5'); +module.exports['md5_file'] = require('./md5_file'); +module.exports['metaphone'] = require('./metaphone'); +module.exports['money_format'] = require('./money_format'); +module.exports['nl2br'] = require('./nl2br'); +module.exports['nl_langinfo'] = require('./nl_langinfo'); +module.exports['number_format'] = require('./number_format'); +module.exports['ord'] = require('./ord'); +module.exports['parse_str'] = require('./parse_str'); +module.exports['printf'] = require('./printf'); +module.exports['quoted_printable_decode'] = require('./quoted_printable_decode'); +module.exports['quoted_printable_encode'] = require('./quoted_printable_encode'); +module.exports['quotemeta'] = require('./quotemeta'); +module.exports['rtrim'] = require('./rtrim'); +module.exports['setlocale'] = require('./setlocale'); +module.exports['sha1'] = require('./sha1'); +module.exports['sha1_file'] = require('./sha1_file'); +module.exports['similar_text'] = require('./similar_text'); +module.exports['soundex'] = require('./soundex'); +module.exports['split'] = require('./split'); +module.exports['sprintf'] = require('./sprintf'); +module.exports['sscanf'] = require('./sscanf'); +module.exports['str_getcsv'] = require('./str_getcsv'); +module.exports['str_ireplace'] = require('./str_ireplace'); +module.exports['str_pad'] = require('./str_pad'); +module.exports['str_repeat'] = require('./str_repeat'); +module.exports['str_replace'] = require('./str_replace'); +module.exports['str_rot13'] = require('./str_rot13'); +module.exports['str_shuffle'] = require('./str_shuffle'); +module.exports['str_split'] = require('./str_split'); +module.exports['str_word_count'] = require('./str_word_count'); +module.exports['strcasecmp'] = require('./strcasecmp'); +module.exports['strchr'] = require('./strchr'); +module.exports['strcmp'] = require('./strcmp'); +module.exports['strcoll'] = require('./strcoll'); +module.exports['strcspn'] = require('./strcspn'); +module.exports['strip_tags'] = require('./strip_tags'); +module.exports['stripos'] = require('./stripos'); +module.exports['stripslashes'] = require('./stripslashes'); +module.exports['stristr'] = require('./stristr'); +module.exports['strlen'] = require('./strlen'); +module.exports['strnatcasecmp'] = require('./strnatcasecmp'); +module.exports['strnatcmp'] = require('./strnatcmp'); +module.exports['strncasecmp'] = require('./strncasecmp'); +module.exports['strncmp'] = require('./strncmp'); +module.exports['strpbrk'] = require('./strpbrk'); +module.exports['strpos'] = require('./strpos'); +module.exports['strrchr'] = require('./strrchr'); +module.exports['strrev'] = require('./strrev'); +module.exports['strripos'] = require('./strripos'); +module.exports['strrpos'] = require('./strrpos'); +module.exports['strspn'] = require('./strspn'); +module.exports['strstr'] = require('./strstr'); +module.exports['strtok'] = require('./strtok'); +module.exports['strtolower'] = require('./strtolower'); +module.exports['strtoupper'] = require('./strtoupper'); +module.exports['strtr'] = require('./strtr'); +module.exports['substr'] = require('./substr'); +module.exports['substr_compare'] = require('./substr_compare'); +module.exports['substr_count'] = require('./substr_count'); +module.exports['substr_replace'] = require('./substr_replace'); +module.exports['trim'] = require('./trim'); +module.exports['ucfirst'] = require('./ucfirst'); +module.exports['ucwords'] = require('./ucwords'); +module.exports['vprintf'] = require('./vprintf'); +module.exports['vsprintf'] = require('./vsprintf'); +module.exports['wordwrap'] = require('./wordwrap'); +//# sourceMappingURL=index.js.map
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/index.js.map b/node_modules/locutus/php/strings/index.js.map new file mode 100644 index 0000000..f61d55e --- /dev/null +++ b/node_modules/locutus/php/strings/index.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/php/strings/index.js"],"names":["module","exports","require"],"mappings":";;AAAAA,OAAOC,OAAP,CAAe,aAAf,IAAgCC,QAAQ,eAAR,CAAhC;AACAF,OAAOC,OAAP,CAAe,YAAf,IAA+BC,QAAQ,cAAR,CAA/B;AACAF,OAAOC,OAAP,CAAe,SAAf,IAA4BC,QAAQ,WAAR,CAA5B;AACAF,OAAOC,OAAP,CAAe,MAAf,IAAyBC,QAAQ,QAAR,CAAzB;AACAF,OAAOC,OAAP,CAAe,KAAf,IAAwBC,QAAQ,OAAR,CAAxB;AACAF,OAAOC,OAAP,CAAe,aAAf,IAAgCC,QAAQ,eAAR,CAAhC;AACAF,OAAOC,OAAP,CAAe,oBAAf,IAAuCC,QAAQ,sBAAR,CAAvC;AACAF,OAAOC,OAAP,CAAe,kBAAf,IAAqCC,QAAQ,oBAAR,CAArC;AACAF,OAAOC,OAAP,CAAe,aAAf,IAAgCC,QAAQ,eAAR,CAAhC;AACAF,OAAOC,OAAP,CAAe,OAAf,IAA0BC,QAAQ,SAAR,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module.exports['addcslashes'] = require('./addcslashes')\nmodule.exports['addslashes'] = require('./addslashes')\nmodule.exports['bin2hex'] = require('./bin2hex')\nmodule.exports['chop'] = require('./chop')\nmodule.exports['chr'] = require('./chr')\nmodule.exports['chunk_split'] = require('./chunk_split')\nmodule.exports['convert_cyr_string'] = require('./convert_cyr_string')\nmodule.exports['convert_uuencode'] = require('./convert_uuencode')\nmodule.exports['count_chars'] = require('./count_chars')\nmodule.exports['crc32'] = require('./crc32')\nmodule.exports['echo'] = require('./echo')\nmodule.exports['explode'] = require('./explode')\nmodule.exports['get_html_translation_table'] = require('./get_html_translation_table')\nmodule.exports['hex2bin'] = require('./hex2bin')\nmodule.exports['html_entity_decode'] = require('./html_entity_decode')\nmodule.exports['htmlentities'] = require('./htmlentities')\nmodule.exports['htmlspecialchars'] = require('./htmlspecialchars')\nmodule.exports['htmlspecialchars_decode'] = require('./htmlspecialchars_decode')\nmodule.exports['implode'] = require('./implode')\nmodule.exports['join'] = require('./join')\nmodule.exports['lcfirst'] = require('./lcfirst')\nmodule.exports['levenshtein'] = require('./levenshtein')\nmodule.exports['localeconv'] = require('./localeconv')\nmodule.exports['ltrim'] = require('./ltrim')\nmodule.exports['md5'] = require('./md5')\nmodule.exports['md5_file'] = require('./md5_file')\nmodule.exports['metaphone'] = require('./metaphone')\nmodule.exports['money_format'] = require('./money_format')\nmodule.exports['nl2br'] = require('./nl2br')\nmodule.exports['nl_langinfo'] = require('./nl_langinfo')\nmodule.exports['number_format'] = require('./number_format')\nmodule.exports['ord'] = require('./ord')\nmodule.exports['parse_str'] = require('./parse_str')\nmodule.exports['printf'] = require('./printf')\nmodule.exports['quoted_printable_decode'] = require('./quoted_printable_decode')\nmodule.exports['quoted_printable_encode'] = require('./quoted_printable_encode')\nmodule.exports['quotemeta'] = require('./quotemeta')\nmodule.exports['rtrim'] = require('./rtrim')\nmodule.exports['setlocale'] = require('./setlocale')\nmodule.exports['sha1'] = require('./sha1')\nmodule.exports['sha1_file'] = require('./sha1_file')\nmodule.exports['similar_text'] = require('./similar_text')\nmodule.exports['soundex'] = require('./soundex')\nmodule.exports['split'] = require('./split')\nmodule.exports['sprintf'] = require('./sprintf')\nmodule.exports['sscanf'] = require('./sscanf')\nmodule.exports['str_getcsv'] = require('./str_getcsv')\nmodule.exports['str_ireplace'] = require('./str_ireplace')\nmodule.exports['str_pad'] = require('./str_pad')\nmodule.exports['str_repeat'] = require('./str_repeat')\nmodule.exports['str_replace'] = require('./str_replace')\nmodule.exports['str_rot13'] = require('./str_rot13')\nmodule.exports['str_shuffle'] = require('./str_shuffle')\nmodule.exports['str_split'] = require('./str_split')\nmodule.exports['str_word_count'] = require('./str_word_count')\nmodule.exports['strcasecmp'] = require('./strcasecmp')\nmodule.exports['strchr'] = require('./strchr')\nmodule.exports['strcmp'] = require('./strcmp')\nmodule.exports['strcoll'] = require('./strcoll')\nmodule.exports['strcspn'] = require('./strcspn')\nmodule.exports['strip_tags'] = require('./strip_tags')\nmodule.exports['stripos'] = require('./stripos')\nmodule.exports['stripslashes'] = require('./stripslashes')\nmodule.exports['stristr'] = require('./stristr')\nmodule.exports['strlen'] = require('./strlen')\nmodule.exports['strnatcasecmp'] = require('./strnatcasecmp')\nmodule.exports['strnatcmp'] = require('./strnatcmp')\nmodule.exports['strncasecmp'] = require('./strncasecmp')\nmodule.exports['strncmp'] = require('./strncmp')\nmodule.exports['strpbrk'] = require('./strpbrk')\nmodule.exports['strpos'] = require('./strpos')\nmodule.exports['strrchr'] = require('./strrchr')\nmodule.exports['strrev'] = require('./strrev')\nmodule.exports['strripos'] = require('./strripos')\nmodule.exports['strrpos'] = require('./strrpos')\nmodule.exports['strspn'] = require('./strspn')\nmodule.exports['strstr'] = require('./strstr')\nmodule.exports['strtok'] = require('./strtok')\nmodule.exports['strtolower'] = require('./strtolower')\nmodule.exports['strtoupper'] = require('./strtoupper')\nmodule.exports['strtr'] = require('./strtr')\nmodule.exports['substr'] = require('./substr')\nmodule.exports['substr_compare'] = require('./substr_compare')\nmodule.exports['substr_count'] = require('./substr_count')\nmodule.exports['substr_replace'] = require('./substr_replace')\nmodule.exports['trim'] = require('./trim')\nmodule.exports['ucfirst'] = require('./ucfirst')\nmodule.exports['ucwords'] = require('./ucwords')\nmodule.exports['vprintf'] = require('./vprintf')\nmodule.exports['vsprintf'] = require('./vsprintf')\nmodule.exports['wordwrap'] = require('./wordwrap')\n"]}
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/join.js b/node_modules/locutus/php/strings/join.js new file mode 100644 index 0000000..f0e8718 --- /dev/null +++ b/node_modules/locutus/php/strings/join.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports = function join(glue, pieces) { + // discuss at: http://locutus.io/php/join/ + // original by: Kevin van Zonneveld (http://kvz.io) + // example 1: join(' ', ['Kevin', 'van', 'Zonneveld']) + // returns 1: 'Kevin van Zonneveld' + + var implode = require('../strings/implode'); + return implode(glue, pieces); +}; +//# sourceMappingURL=join.js.map
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/join.js.map b/node_modules/locutus/php/strings/join.js.map new file mode 100644 index 0000000..91d5d71 --- /dev/null +++ b/node_modules/locutus/php/strings/join.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/php/strings/join.js"],"names":["module","exports","join","glue","pieces","implode","require"],"mappings":";;AAAAA,OAAOC,OAAP,GAAiB,SAASC,IAAT,CAAeC,IAAf,EAAqBC,MAArB,EAA6B;AAC5C;AACA;AACA;AACA;;AAEA,MAAIC,UAAUC,QAAQ,oBAAR,CAAd;AACA,SAAOD,QAAQF,IAAR,EAAcC,MAAd,CAAP;AACD,CARD","file":"join.js","sourcesContent":["module.exports = function join (glue, pieces) {\n // discuss at: http://locutus.io/php/join/\n // original by: Kevin van Zonneveld (http://kvz.io)\n // example 1: join(' ', ['Kevin', 'van', 'Zonneveld'])\n // returns 1: 'Kevin van Zonneveld'\n\n var implode = require('../strings/implode')\n return implode(glue, pieces)\n}\n"]}
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/lcfirst.js b/node_modules/locutus/php/strings/lcfirst.js new file mode 100644 index 0000000..ea8df57 --- /dev/null +++ b/node_modules/locutus/php/strings/lcfirst.js @@ -0,0 +1,13 @@ +'use strict'; + +module.exports = function lcfirst(str) { + // discuss at: http://locutus.io/php/lcfirst/ + // original by: Brett Zamir (http://brett-zamir.me) + // example 1: lcfirst('Kevin Van Zonneveld') + // returns 1: 'kevin Van Zonneveld' + + str += ''; + var f = str.charAt(0).toLowerCase(); + return f + str.substr(1); +}; +//# sourceMappingURL=lcfirst.js.map
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/lcfirst.js.map b/node_modules/locutus/php/strings/lcfirst.js.map new file mode 100644 index 0000000..a3508d1 --- /dev/null +++ b/node_modules/locutus/php/strings/lcfirst.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/php/strings/lcfirst.js"],"names":["module","exports","lcfirst","str","f","charAt","toLowerCase","substr"],"mappings":";;AAAAA,OAAOC,OAAP,GAAiB,SAASC,OAAT,CAAkBC,GAAlB,EAAuB;AACtC;AACA;AACA;AACA;;AAEAA,SAAO,EAAP;AACA,MAAIC,IAAID,IAAIE,MAAJ,CAAW,CAAX,EACLC,WADK,EAAR;AAEA,SAAOF,IAAID,IAAII,MAAJ,CAAW,CAAX,CAAX;AACD,CAVD","file":"lcfirst.js","sourcesContent":["module.exports = function lcfirst (str) {\n // discuss at: http://locutus.io/php/lcfirst/\n // original by: Brett Zamir (http://brett-zamir.me)\n // example 1: lcfirst('Kevin Van Zonneveld')\n // returns 1: 'kevin Van Zonneveld'\n\n str += ''\n var f = str.charAt(0)\n .toLowerCase()\n return f + str.substr(1)\n}\n"]}
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/levenshtein.js b/node_modules/locutus/php/strings/levenshtein.js new file mode 100644 index 0000000..6725f0e --- /dev/null +++ b/node_modules/locutus/php/strings/levenshtein.js @@ -0,0 +1,94 @@ +'use strict'; + +module.exports = function levenshtein(s1, s2, costIns, costRep, costDel) { + // discuss at: http://locutus.io/php/levenshtein/ + // original by: Carlos R. L. Rodrigues (http://www.jsfromhell.com) + // bugfixed by: Onno Marsman (https://twitter.com/onnomarsman) + // revised by: Andrea Giammarchi (http://webreflection.blogspot.com) + // reimplemented by: Brett Zamir (http://brett-zamir.me) + // reimplemented by: Alexander M Beedie + // reimplemented by: Rafał Kukawski (http://blog.kukawski.pl) + // example 1: levenshtein('Kevin van Zonneveld', 'Kevin van Sommeveld') + // returns 1: 3 + // example 2: levenshtein("carrrot", "carrots") + // returns 2: 2 + // example 3: levenshtein("carrrot", "carrots", 2, 3, 4) + // returns 3: 6 + + // var LEVENSHTEIN_MAX_LENGTH = 255 // PHP limits the function to max 255 character-long strings + + costIns = costIns == null ? 1 : +costIns; + costRep = costRep == null ? 1 : +costRep; + costDel = costDel == null ? 1 : +costDel; + + if (s1 === s2) { + return 0; + } + + var l1 = s1.length; + var l2 = s2.length; + + if (l1 === 0) { + return l2 * costIns; + } + if (l2 === 0) { + return l1 * costDel; + } + + // Enable the 3 lines below to set the same limits on string length as PHP does + // if (l1 > LEVENSHTEIN_MAX_LENGTH || l2 > LEVENSHTEIN_MAX_LENGTH) { + // return -1; + // } + + var split = false; + try { + split = !'0'[0]; + } catch (e) { + // Earlier IE may not support access by string index + split = true; + } + + if (split) { + s1 = s1.split(''); + s2 = s2.split(''); + } + + var p1 = new Array(l2 + 1); + var p2 = new Array(l2 + 1); + + var i1, i2, c0, c1, c2, tmp; + + for (i2 = 0; i2 <= l2; i2++) { + p1[i2] = i2 * costIns; + } + + for (i1 = 0; i1 < l1; i1++) { + p2[0] = p1[0] + costDel; + + for (i2 = 0; i2 < l2; i2++) { + c0 = p1[i2] + (s1[i1] === s2[i2] ? 0 : costRep); + c1 = p1[i2 + 1] + costDel; + + if (c1 < c0) { + c0 = c1; + } + + c2 = p2[i2] + costIns; + + if (c2 < c0) { + c0 = c2; + } + + p2[i2 + 1] = c0; + } + + tmp = p1; + p1 = p2; + p2 = tmp; + } + + c0 = p1[l2]; + + return c0; +}; +//# sourceMappingURL=levenshtein.js.map
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/levenshtein.js.map b/node_modules/locutus/php/strings/levenshtein.js.map new file mode 100644 index 0000000..d7149c4 --- /dev/null +++ b/node_modules/locutus/php/strings/levenshtein.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/php/strings/levenshtein.js"],"names":["module","exports","levenshtein","s1","s2","costIns","costRep","costDel","l1","length","l2","split","e","p1","Array","p2","i1","i2","c0","c1","c2","tmp"],"mappings":";;AAAAA,OAAOC,OAAP,GAAiB,SAASC,WAAT,CAAsBC,EAAtB,EAA0BC,EAA1B,EAA8BC,OAA9B,EAAuCC,OAAvC,EAAgDC,OAAhD,EAAyD;AACxE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEAF,YAAUA,WAAW,IAAX,GAAkB,CAAlB,GAAsB,CAACA,OAAjC;AACAC,YAAUA,WAAW,IAAX,GAAkB,CAAlB,GAAsB,CAACA,OAAjC;AACAC,YAAUA,WAAW,IAAX,GAAkB,CAAlB,GAAsB,CAACA,OAAjC;;AAEA,MAAIJ,OAAOC,EAAX,EAAe;AACb,WAAO,CAAP;AACD;;AAED,MAAII,KAAKL,GAAGM,MAAZ;AACA,MAAIC,KAAKN,GAAGK,MAAZ;;AAEA,MAAID,OAAO,CAAX,EAAc;AACZ,WAAOE,KAAKL,OAAZ;AACD;AACD,MAAIK,OAAO,CAAX,EAAc;AACZ,WAAOF,KAAKD,OAAZ;AACD;;AAED;AACA;AACA;AACA;;AAEA,MAAII,QAAQ,KAAZ;AACA,MAAI;AACFA,YAAQ,CAAE,GAAD,CAAM,CAAN,CAAT;AACD,GAFD,CAEE,OAAOC,CAAP,EAAU;AACV;AACAD,YAAQ,IAAR;AACD;;AAED,MAAIA,KAAJ,EAAW;AACTR,SAAKA,GAAGQ,KAAH,CAAS,EAAT,CAAL;AACAP,SAAKA,GAAGO,KAAH,CAAS,EAAT,CAAL;AACD;;AAED,MAAIE,KAAK,IAAIC,KAAJ,CAAUJ,KAAK,CAAf,CAAT;AACA,MAAIK,KAAK,IAAID,KAAJ,CAAUJ,KAAK,CAAf,CAAT;;AAEA,MAAIM,EAAJ,EAAQC,EAAR,EAAYC,EAAZ,EAAgBC,EAAhB,EAAoBC,EAApB,EAAwBC,GAAxB;;AAEA,OAAKJ,KAAK,CAAV,EAAaA,MAAMP,EAAnB,EAAuBO,IAAvB,EAA6B;AAC3BJ,OAAGI,EAAH,IAASA,KAAKZ,OAAd;AACD;;AAED,OAAKW,KAAK,CAAV,EAAaA,KAAKR,EAAlB,EAAsBQ,IAAtB,EAA4B;AAC1BD,OAAG,CAAH,IAAQF,GAAG,CAAH,IAAQN,OAAhB;;AAEA,SAAKU,KAAK,CAAV,EAAaA,KAAKP,EAAlB,EAAsBO,IAAtB,EAA4B;AAC1BC,WAAKL,GAAGI,EAAH,KAAWd,GAAGa,EAAH,MAAWZ,GAAGa,EAAH,CAAZ,GAAsB,CAAtB,GAA0BX,OAApC,CAAL;AACAa,WAAKN,GAAGI,KAAK,CAAR,IAAaV,OAAlB;;AAEA,UAAIY,KAAKD,EAAT,EAAa;AACXA,aAAKC,EAAL;AACD;;AAEDC,WAAKL,GAAGE,EAAH,IAASZ,OAAd;;AAEA,UAAIe,KAAKF,EAAT,EAAa;AACXA,aAAKE,EAAL;AACD;;AAEDL,SAAGE,KAAK,CAAR,IAAaC,EAAb;AACD;;AAEDG,UAAMR,EAAN;AACAA,SAAKE,EAAL;AACAA,SAAKM,GAAL;AACD;;AAEDH,OAAKL,GAAGH,EAAH,CAAL;;AAEA,SAAOQ,EAAP;AACD,CA1FD","file":"levenshtein.js","sourcesContent":["module.exports = function levenshtein (s1, s2, costIns, costRep, costDel) {\n // discuss at: http://locutus.io/php/levenshtein/\n // original by: Carlos R. L. Rodrigues (http://www.jsfromhell.com)\n // bugfixed by: Onno Marsman (https://twitter.com/onnomarsman)\n // revised by: Andrea Giammarchi (http://webreflection.blogspot.com)\n // reimplemented by: Brett Zamir (http://brett-zamir.me)\n // reimplemented by: Alexander M Beedie\n // reimplemented by: Rafał Kukawski (http://blog.kukawski.pl)\n // example 1: levenshtein('Kevin van Zonneveld', 'Kevin van Sommeveld')\n // returns 1: 3\n // example 2: levenshtein(\"carrrot\", \"carrots\")\n // returns 2: 2\n // example 3: levenshtein(\"carrrot\", \"carrots\", 2, 3, 4)\n // returns 3: 6\n\n // var LEVENSHTEIN_MAX_LENGTH = 255 // PHP limits the function to max 255 character-long strings\n\n costIns = costIns == null ? 1 : +costIns\n costRep = costRep == null ? 1 : +costRep\n costDel = costDel == null ? 1 : +costDel\n\n if (s1 === s2) {\n return 0\n }\n\n var l1 = s1.length\n var l2 = s2.length\n\n if (l1 === 0) {\n return l2 * costIns\n }\n if (l2 === 0) {\n return l1 * costDel\n }\n\n // Enable the 3 lines below to set the same limits on string length as PHP does\n // if (l1 > LEVENSHTEIN_MAX_LENGTH || l2 > LEVENSHTEIN_MAX_LENGTH) {\n // return -1;\n // }\n\n var split = false\n try {\n split = !('0')[0]\n } catch (e) {\n // Earlier IE may not support access by string index\n split = true\n }\n\n if (split) {\n s1 = s1.split('')\n s2 = s2.split('')\n }\n\n var p1 = new Array(l2 + 1)\n var p2 = new Array(l2 + 1)\n\n var i1, i2, c0, c1, c2, tmp\n\n for (i2 = 0; i2 <= l2; i2++) {\n p1[i2] = i2 * costIns\n }\n\n for (i1 = 0; i1 < l1; i1++) {\n p2[0] = p1[0] + costDel\n\n for (i2 = 0; i2 < l2; i2++) {\n c0 = p1[i2] + ((s1[i1] === s2[i2]) ? 0 : costRep)\n c1 = p1[i2 + 1] + costDel\n\n if (c1 < c0) {\n c0 = c1\n }\n\n c2 = p2[i2] + costIns\n\n if (c2 < c0) {\n c0 = c2\n }\n\n p2[i2 + 1] = c0\n }\n\n tmp = p1\n p1 = p2\n p2 = tmp\n }\n\n c0 = p1[l2]\n\n return c0\n}\n"]}
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/localeconv.js b/node_modules/locutus/php/strings/localeconv.js new file mode 100644 index 0000000..f61c25b --- /dev/null +++ b/node_modules/locutus/php/strings/localeconv.js @@ -0,0 +1,33 @@ +'use strict'; + +module.exports = function localeconv() { + // discuss at: http://locutus.io/php/localeconv/ + // original by: Brett Zamir (http://brett-zamir.me) + // example 1: setlocale('LC_ALL', 'en_US') + // example 1: localeconv() + // returns 1: {decimal_point: '.', thousands_sep: '', positive_sign: '', negative_sign: '-', int_frac_digits: 2, frac_digits: 2, p_cs_precedes: 1, p_sep_by_space: 0, n_cs_precedes: 1, n_sep_by_space: 0, p_sign_posn: 1, n_sign_posn: 1, grouping: [], int_curr_symbol: 'USD ', currency_symbol: '$', mon_decimal_point: '.', mon_thousands_sep: ',', mon_grouping: [3, 3]} + + var setlocale = require('../strings/setlocale'); + + var arr = {}; + var prop = ''; + + // ensure setup of localization variables takes place, if not already + setlocale('LC_ALL', 0); + + var $global = typeof window !== 'undefined' ? window : global; + $global.$locutus = $global.$locutus || {}; + var $locutus = $global.$locutus; + $locutus.php = $locutus.php || {}; + + // Make copies + for (prop in $locutus.php.locales[$locutus.php.localeCategories.LC_NUMERIC].LC_NUMERIC) { + arr[prop] = $locutus.php.locales[$locutus.php.localeCategories.LC_NUMERIC].LC_NUMERIC[prop]; + } + for (prop in $locutus.php.locales[$locutus.php.localeCategories.LC_MONETARY].LC_MONETARY) { + arr[prop] = $locutus.php.locales[$locutus.php.localeCategories.LC_MONETARY].LC_MONETARY[prop]; + } + + return arr; +}; +//# sourceMappingURL=localeconv.js.map
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/localeconv.js.map b/node_modules/locutus/php/strings/localeconv.js.map new file mode 100644 index 0000000..a63abcb --- /dev/null +++ b/node_modules/locutus/php/strings/localeconv.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/php/strings/localeconv.js"],"names":["module","exports","localeconv","setlocale","require","arr","prop","$global","window","global","$locutus","php","locales","localeCategories","LC_NUMERIC","LC_MONETARY"],"mappings":";;AAAAA,OAAOC,OAAP,GAAiB,SAASC,UAAT,GAAuB;AACtC;AACA;AACA;AACA;AACA;;AAEA,MAAIC,YAAYC,QAAQ,sBAAR,CAAhB;;AAEA,MAAIC,MAAM,EAAV;AACA,MAAIC,OAAO,EAAX;;AAEA;AACAH,YAAU,QAAV,EAAoB,CAApB;;AAEA,MAAII,UAAW,OAAOC,MAAP,KAAkB,WAAlB,GAAgCA,MAAhC,GAAyCC,MAAxD;AACAF,UAAQG,QAAR,GAAmBH,QAAQG,QAAR,IAAoB,EAAvC;AACA,MAAIA,WAAWH,QAAQG,QAAvB;AACAA,WAASC,GAAT,GAAeD,SAASC,GAAT,IAAgB,EAA/B;;AAEA;AACA,OAAKL,IAAL,IAAaI,SAASC,GAAT,CAAaC,OAAb,CAAqBF,SAASC,GAAT,CAAaE,gBAAb,CAA8BC,UAAnD,EAA+DA,UAA5E,EAAwF;AACtFT,QAAIC,IAAJ,IAAYI,SAASC,GAAT,CAAaC,OAAb,CAAqBF,SAASC,GAAT,CAAaE,gBAAb,CAA8BC,UAAnD,EAA+DA,UAA/D,CAA0ER,IAA1E,CAAZ;AACD;AACD,OAAKA,IAAL,IAAaI,SAASC,GAAT,CAAaC,OAAb,CAAqBF,SAASC,GAAT,CAAaE,gBAAb,CAA8BE,WAAnD,EAAgEA,WAA7E,EAA0F;AACxFV,QAAIC,IAAJ,IAAYI,SAASC,GAAT,CAAaC,OAAb,CAAqBF,SAASC,GAAT,CAAaE,gBAAb,CAA8BE,WAAnD,EAAgEA,WAAhE,CAA4ET,IAA5E,CAAZ;AACD;;AAED,SAAOD,GAAP;AACD,CA7BD","file":"localeconv.js","sourcesContent":["module.exports = function localeconv () {\n // discuss at: http://locutus.io/php/localeconv/\n // original by: Brett Zamir (http://brett-zamir.me)\n // example 1: setlocale('LC_ALL', 'en_US')\n // example 1: localeconv()\n // returns 1: {decimal_point: '.', thousands_sep: '', positive_sign: '', negative_sign: '-', int_frac_digits: 2, frac_digits: 2, p_cs_precedes: 1, p_sep_by_space: 0, n_cs_precedes: 1, n_sep_by_space: 0, p_sign_posn: 1, n_sign_posn: 1, grouping: [], int_curr_symbol: 'USD ', currency_symbol: '$', mon_decimal_point: '.', mon_thousands_sep: ',', mon_grouping: [3, 3]}\n\n var setlocale = require('../strings/setlocale')\n\n var arr = {}\n var prop = ''\n\n // ensure setup of localization variables takes place, if not already\n setlocale('LC_ALL', 0)\n\n var $global = (typeof window !== 'undefined' ? window : global)\n $global.$locutus = $global.$locutus || {}\n var $locutus = $global.$locutus\n $locutus.php = $locutus.php || {}\n\n // Make copies\n for (prop in $locutus.php.locales[$locutus.php.localeCategories.LC_NUMERIC].LC_NUMERIC) {\n arr[prop] = $locutus.php.locales[$locutus.php.localeCategories.LC_NUMERIC].LC_NUMERIC[prop]\n }\n for (prop in $locutus.php.locales[$locutus.php.localeCategories.LC_MONETARY].LC_MONETARY) {\n arr[prop] = $locutus.php.locales[$locutus.php.localeCategories.LC_MONETARY].LC_MONETARY[prop]\n }\n\n return arr\n}\n"]}
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/ltrim.js b/node_modules/locutus/php/strings/ltrim.js new file mode 100644 index 0000000..f47b69c --- /dev/null +++ b/node_modules/locutus/php/strings/ltrim.js @@ -0,0 +1,18 @@ +'use strict'; + +module.exports = function ltrim(str, charlist) { + // discuss at: http://locutus.io/php/ltrim/ + // original by: Kevin van Zonneveld (http://kvz.io) + // input by: Erkekjetter + // improved by: Kevin van Zonneveld (http://kvz.io) + // bugfixed by: Onno Marsman (https://twitter.com/onnomarsman) + // example 1: ltrim(' Kevin van Zonneveld ') + // returns 1: 'Kevin van Zonneveld ' + + charlist = !charlist ? ' \\s\xA0' : (charlist + '').replace(/([[\]().?/*{}+$^:])/g, '$1'); + + var re = new RegExp('^[' + charlist + ']+', 'g'); + + return (str + '').replace(re, ''); +}; +//# sourceMappingURL=ltrim.js.map
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/ltrim.js.map b/node_modules/locutus/php/strings/ltrim.js.map new file mode 100644 index 0000000..ad7f2f5 --- /dev/null +++ b/node_modules/locutus/php/strings/ltrim.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/php/strings/ltrim.js"],"names":["module","exports","ltrim","str","charlist","replace","re","RegExp"],"mappings":";;AAAAA,OAAOC,OAAP,GAAiB,SAASC,KAAT,CAAgBC,GAAhB,EAAqBC,QAArB,EAA+B;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;;AAEAA,aAAW,CAACA,QAAD,GAAY,UAAZ,GAA2B,CAACA,WAAW,EAAZ,EACnCC,OADmC,CAC3B,sBAD2B,EACH,IADG,CAAtC;;AAGA,MAAIC,KAAK,IAAIC,MAAJ,CAAW,OAAOH,QAAP,GAAkB,IAA7B,EAAmC,GAAnC,CAAT;;AAEA,SAAO,CAACD,MAAM,EAAP,EACJE,OADI,CACIC,EADJ,EACQ,EADR,CAAP;AAED,CAhBD","file":"ltrim.js","sourcesContent":["module.exports = function ltrim (str, charlist) {\n // discuss at: http://locutus.io/php/ltrim/\n // original by: Kevin van Zonneveld (http://kvz.io)\n // input by: Erkekjetter\n // improved by: Kevin van Zonneveld (http://kvz.io)\n // bugfixed by: Onno Marsman (https://twitter.com/onnomarsman)\n // example 1: ltrim(' Kevin van Zonneveld ')\n // returns 1: 'Kevin van Zonneveld '\n\n charlist = !charlist ? ' \\\\s\\u00A0' : (charlist + '')\n .replace(/([[\\]().?/*{}+$^:])/g, '$1')\n\n var re = new RegExp('^[' + charlist + ']+', 'g')\n\n return (str + '')\n .replace(re, '')\n}\n"]}
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/md5.js b/node_modules/locutus/php/strings/md5.js new file mode 100644 index 0000000..5a77bfc --- /dev/null +++ b/node_modules/locutus/php/strings/md5.js @@ -0,0 +1,243 @@ +'use strict'; + +module.exports = function md5(str) { + // discuss at: http://locutus.io/php/md5/ + // original by: Webtoolkit.info (http://www.webtoolkit.info/) + // improved by: Michael White (http://getsprink.com) + // improved by: Jack + // improved by: Kevin van Zonneveld (http://kvz.io) + // input by: Brett Zamir (http://brett-zamir.me) + // bugfixed by: Kevin van Zonneveld (http://kvz.io) + // note 1: Keep in mind that in accordance with PHP, the whole string is buffered and then + // note 1: hashed. If available, we'd recommend using Node's native crypto modules directly + // note 1: in a steaming fashion for faster and more efficient hashing + // example 1: md5('Kevin van Zonneveld') + // returns 1: '6e658d4bfcb59cc13f96c14450ac40b9' + + var hash; + try { + var crypto = require('crypto'); + var md5sum = crypto.createHash('md5'); + md5sum.update(str); + hash = md5sum.digest('hex'); + } catch (e) { + hash = undefined; + } + + if (hash !== undefined) { + return hash; + } + + var utf8Encode = require('../xml/utf8_encode'); + var xl; + + var _rotateLeft = function _rotateLeft(lValue, iShiftBits) { + return lValue << iShiftBits | lValue >>> 32 - iShiftBits; + }; + + var _addUnsigned = function _addUnsigned(lX, lY) { + var lX4, lY4, lX8, lY8, lResult; + lX8 = lX & 0x80000000; + lY8 = lY & 0x80000000; + lX4 = lX & 0x40000000; + lY4 = lY & 0x40000000; + lResult = (lX & 0x3FFFFFFF) + (lY & 0x3FFFFFFF); + if (lX4 & lY4) { + return lResult ^ 0x80000000 ^ lX8 ^ lY8; + } + if (lX4 | lY4) { + if (lResult & 0x40000000) { + return lResult ^ 0xC0000000 ^ lX8 ^ lY8; + } else { + return lResult ^ 0x40000000 ^ lX8 ^ lY8; + } + } else { + return lResult ^ lX8 ^ lY8; + } + }; + + var _F = function _F(x, y, z) { + return x & y | ~x & z; + }; + var _G = function _G(x, y, z) { + return x & z | y & ~z; + }; + var _H = function _H(x, y, z) { + return x ^ y ^ z; + }; + var _I = function _I(x, y, z) { + return y ^ (x | ~z); + }; + + var _FF = function _FF(a, b, c, d, x, s, ac) { + a = _addUnsigned(a, _addUnsigned(_addUnsigned(_F(b, c, d), x), ac)); + return _addUnsigned(_rotateLeft(a, s), b); + }; + + var _GG = function _GG(a, b, c, d, x, s, ac) { + a = _addUnsigned(a, _addUnsigned(_addUnsigned(_G(b, c, d), x), ac)); + return _addUnsigned(_rotateLeft(a, s), b); + }; + + var _HH = function _HH(a, b, c, d, x, s, ac) { + a = _addUnsigned(a, _addUnsigned(_addUnsigned(_H(b, c, d), x), ac)); + return _addUnsigned(_rotateLeft(a, s), b); + }; + + var _II = function _II(a, b, c, d, x, s, ac) { + a = _addUnsigned(a, _addUnsigned(_addUnsigned(_I(b, c, d), x), ac)); + return _addUnsigned(_rotateLeft(a, s), b); + }; + + var _convertToWordArray = function _convertToWordArray(str) { + var lWordCount; + var lMessageLength = str.length; + var lNumberOfWordsTemp1 = lMessageLength + 8; + var lNumberOfWordsTemp2 = (lNumberOfWordsTemp1 - lNumberOfWordsTemp1 % 64) / 64; + var lNumberOfWords = (lNumberOfWordsTemp2 + 1) * 16; + var lWordArray = new Array(lNumberOfWords - 1); + var lBytePosition = 0; + var lByteCount = 0; + while (lByteCount < lMessageLength) { + lWordCount = (lByteCount - lByteCount % 4) / 4; + lBytePosition = lByteCount % 4 * 8; + lWordArray[lWordCount] = lWordArray[lWordCount] | str.charCodeAt(lByteCount) << lBytePosition; + lByteCount++; + } + lWordCount = (lByteCount - lByteCount % 4) / 4; + lBytePosition = lByteCount % 4 * 8; + lWordArray[lWordCount] = lWordArray[lWordCount] | 0x80 << lBytePosition; + lWordArray[lNumberOfWords - 2] = lMessageLength << 3; + lWordArray[lNumberOfWords - 1] = lMessageLength >>> 29; + return lWordArray; + }; + + var _wordToHex = function _wordToHex(lValue) { + var wordToHexValue = ''; + var wordToHexValueTemp = ''; + var lByte; + var lCount; + + for (lCount = 0; lCount <= 3; lCount++) { + lByte = lValue >>> lCount * 8 & 255; + wordToHexValueTemp = '0' + lByte.toString(16); + wordToHexValue = wordToHexValue + wordToHexValueTemp.substr(wordToHexValueTemp.length - 2, 2); + } + return wordToHexValue; + }; + + var x = []; + var k; + var AA; + var BB; + var CC; + var DD; + var a; + var b; + var c; + var d; + var S11 = 7; + var S12 = 12; + var S13 = 17; + var S14 = 22; + var S21 = 5; + var S22 = 9; + var S23 = 14; + var S24 = 20; + var S31 = 4; + var S32 = 11; + var S33 = 16; + var S34 = 23; + var S41 = 6; + var S42 = 10; + var S43 = 15; + var S44 = 21; + + str = utf8Encode(str); + x = _convertToWordArray(str); + a = 0x67452301; + b = 0xEFCDAB89; + c = 0x98BADCFE; + d = 0x10325476; + + xl = x.length; + for (k = 0; k < xl; k += 16) { + AA = a; + BB = b; + CC = c; + DD = d; + a = _FF(a, b, c, d, x[k + 0], S11, 0xD76AA478); + d = _FF(d, a, b, c, x[k + 1], S12, 0xE8C7B756); + c = _FF(c, d, a, b, x[k + 2], S13, 0x242070DB); + b = _FF(b, c, d, a, x[k + 3], S14, 0xC1BDCEEE); + a = _FF(a, b, c, d, x[k + 4], S11, 0xF57C0FAF); + d = _FF(d, a, b, c, x[k + 5], S12, 0x4787C62A); + c = _FF(c, d, a, b, x[k + 6], S13, 0xA8304613); + b = _FF(b, c, d, a, x[k + 7], S14, 0xFD469501); + a = _FF(a, b, c, d, x[k + 8], S11, 0x698098D8); + d = _FF(d, a, b, c, x[k + 9], S12, 0x8B44F7AF); + c = _FF(c, d, a, b, x[k + 10], S13, 0xFFFF5BB1); + b = _FF(b, c, d, a, x[k + 11], S14, 0x895CD7BE); + a = _FF(a, b, c, d, x[k + 12], S11, 0x6B901122); + d = _FF(d, a, b, c, x[k + 13], S12, 0xFD987193); + c = _FF(c, d, a, b, x[k + 14], S13, 0xA679438E); + b = _FF(b, c, d, a, x[k + 15], S14, 0x49B40821); + a = _GG(a, b, c, d, x[k + 1], S21, 0xF61E2562); + d = _GG(d, a, b, c, x[k + 6], S22, 0xC040B340); + c = _GG(c, d, a, b, x[k + 11], S23, 0x265E5A51); + b = _GG(b, c, d, a, x[k + 0], S24, 0xE9B6C7AA); + a = _GG(a, b, c, d, x[k + 5], S21, 0xD62F105D); + d = _GG(d, a, b, c, x[k + 10], S22, 0x2441453); + c = _GG(c, d, a, b, x[k + 15], S23, 0xD8A1E681); + b = _GG(b, c, d, a, x[k + 4], S24, 0xE7D3FBC8); + a = _GG(a, b, c, d, x[k + 9], S21, 0x21E1CDE6); + d = _GG(d, a, b, c, x[k + 14], S22, 0xC33707D6); + c = _GG(c, d, a, b, x[k + 3], S23, 0xF4D50D87); + b = _GG(b, c, d, a, x[k + 8], S24, 0x455A14ED); + a = _GG(a, b, c, d, x[k + 13], S21, 0xA9E3E905); + d = _GG(d, a, b, c, x[k + 2], S22, 0xFCEFA3F8); + c = _GG(c, d, a, b, x[k + 7], S23, 0x676F02D9); + b = _GG(b, c, d, a, x[k + 12], S24, 0x8D2A4C8A); + a = _HH(a, b, c, d, x[k + 5], S31, 0xFFFA3942); + d = _HH(d, a, b, c, x[k + 8], S32, 0x8771F681); + c = _HH(c, d, a, b, x[k + 11], S33, 0x6D9D6122); + b = _HH(b, c, d, a, x[k + 14], S34, 0xFDE5380C); + a = _HH(a, b, c, d, x[k + 1], S31, 0xA4BEEA44); + d = _HH(d, a, b, c, x[k + 4], S32, 0x4BDECFA9); + c = _HH(c, d, a, b, x[k + 7], S33, 0xF6BB4B60); + b = _HH(b, c, d, a, x[k + 10], S34, 0xBEBFBC70); + a = _HH(a, b, c, d, x[k + 13], S31, 0x289B7EC6); + d = _HH(d, a, b, c, x[k + 0], S32, 0xEAA127FA); + c = _HH(c, d, a, b, x[k + 3], S33, 0xD4EF3085); + b = _HH(b, c, d, a, x[k + 6], S34, 0x4881D05); + a = _HH(a, b, c, d, x[k + 9], S31, 0xD9D4D039); + d = _HH(d, a, b, c, x[k + 12], S32, 0xE6DB99E5); + c = _HH(c, d, a, b, x[k + 15], S33, 0x1FA27CF8); + b = _HH(b, c, d, a, x[k + 2], S34, 0xC4AC5665); + a = _II(a, b, c, d, x[k + 0], S41, 0xF4292244); + d = _II(d, a, b, c, x[k + 7], S42, 0x432AFF97); + c = _II(c, d, a, b, x[k + 14], S43, 0xAB9423A7); + b = _II(b, c, d, a, x[k + 5], S44, 0xFC93A039); + a = _II(a, b, c, d, x[k + 12], S41, 0x655B59C3); + d = _II(d, a, b, c, x[k + 3], S42, 0x8F0CCC92); + c = _II(c, d, a, b, x[k + 10], S43, 0xFFEFF47D); + b = _II(b, c, d, a, x[k + 1], S44, 0x85845DD1); + a = _II(a, b, c, d, x[k + 8], S41, 0x6FA87E4F); + d = _II(d, a, b, c, x[k + 15], S42, 0xFE2CE6E0); + c = _II(c, d, a, b, x[k + 6], S43, 0xA3014314); + b = _II(b, c, d, a, x[k + 13], S44, 0x4E0811A1); + a = _II(a, b, c, d, x[k + 4], S41, 0xF7537E82); + d = _II(d, a, b, c, x[k + 11], S42, 0xBD3AF235); + c = _II(c, d, a, b, x[k + 2], S43, 0x2AD7D2BB); + b = _II(b, c, d, a, x[k + 9], S44, 0xEB86D391); + a = _addUnsigned(a, AA); + b = _addUnsigned(b, BB); + c = _addUnsigned(c, CC); + d = _addUnsigned(d, DD); + } + + var temp = _wordToHex(a) + _wordToHex(b) + _wordToHex(c) + _wordToHex(d); + + return temp.toLowerCase(); +}; +//# sourceMappingURL=md5.js.map
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/md5.js.map b/node_modules/locutus/php/strings/md5.js.map new file mode 100644 index 0000000..2190d9a --- /dev/null +++ b/node_modules/locutus/php/strings/md5.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/php/strings/md5.js"],"names":["module","exports","md5","str","hash","crypto","require","md5sum","createHash","update","digest","e","undefined","utf8Encode","xl","_rotateLeft","lValue","iShiftBits","_addUnsigned","lX","lY","lX4","lY4","lX8","lY8","lResult","_F","x","y","z","_G","_H","_I","_FF","a","b","c","d","s","ac","_GG","_HH","_II","_convertToWordArray","lWordCount","lMessageLength","length","lNumberOfWordsTemp1","lNumberOfWordsTemp2","lNumberOfWords","lWordArray","Array","lBytePosition","lByteCount","charCodeAt","_wordToHex","wordToHexValue","wordToHexValueTemp","lByte","lCount","toString","substr","k","AA","BB","CC","DD","S11","S12","S13","S14","S21","S22","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AAJ,EAAOC,CAAP,EAAUC,CAAV,EAAaH,CAAb,EAAgBP,EAAEmC,IAAI,CAAN,CAAhB,EAA0BoB,GAA1B,EAA+B,UAA/B,CAAJ;AACAhD,QAAIhB,aAAagB,CAAb,EAAgB6B,EAAhB,CAAJ;AACA5B,QAAIjB,aAAaiB,CAAb,EAAgB6B,EAAhB,CAAJ;AACA5B,QAAIlB,aAAakB,CAAb,EAAgB6B,EAAhB,CAAJ;AACA5B,QAAInB,aAAamB,CAAb,EAAgB6B,EAAhB,CAAJ;AACD;;AAED,MAAIiB,OAAO5B,WAAWrB,CAAX,IAAgBqB,WAAWpB,CAAX,CAAhB,GAAgCoB,WAAWnB,CAAX,CAAhC,GAAgDmB,WAAWlB,CAAX,CAA3D;;AAEA,SAAO8C,KAAKC,WAAL,EAAP;AACD,CAhPD","file":"md5.js","sourcesContent":["module.exports = function md5 (str) {\n // discuss at: http://locutus.io/php/md5/\n // original by: Webtoolkit.info (http://www.webtoolkit.info/)\n // improved by: Michael White (http://getsprink.com)\n // improved by: Jack\n // improved by: Kevin van Zonneveld (http://kvz.io)\n // input by: Brett Zamir (http://brett-zamir.me)\n // bugfixed by: Kevin van Zonneveld (http://kvz.io)\n // note 1: Keep in mind that in accordance with PHP, the whole string is buffered and then\n // note 1: hashed. If available, we'd recommend using Node's native crypto modules directly\n // note 1: in a steaming fashion for faster and more efficient hashing\n // example 1: md5('Kevin van Zonneveld')\n // returns 1: '6e658d4bfcb59cc13f96c14450ac40b9'\n\n var hash\n try {\n var crypto = require('crypto')\n var md5sum = crypto.createHash('md5')\n md5sum.update(str)\n hash = md5sum.digest('hex')\n } catch (e) {\n hash = undefined\n }\n\n if (hash !== undefined) {\n return hash\n }\n\n var utf8Encode = require('../xml/utf8_encode')\n var xl\n\n var _rotateLeft = function (lValue, iShiftBits) {\n return (lValue << iShiftBits) | (lValue >>> (32 - iShiftBits))\n }\n\n var _addUnsigned = function (lX, lY) {\n var lX4, lY4, lX8, lY8, lResult\n lX8 = (lX & 0x80000000)\n lY8 = (lY & 0x80000000)\n lX4 = (lX & 0x40000000)\n lY4 = (lY & 0x40000000)\n lResult = (lX & 0x3FFFFFFF) + (lY & 0x3FFFFFFF)\n if (lX4 & lY4) {\n return (lResult ^ 0x80000000 ^ lX8 ^ lY8)\n }\n if (lX4 | lY4) {\n if (lResult & 0x40000000) {\n return (lResult ^ 0xC0000000 ^ lX8 ^ lY8)\n } else {\n return (lResult ^ 0x40000000 ^ lX8 ^ lY8)\n }\n } else {\n return (lResult ^ lX8 ^ lY8)\n }\n }\n\n var _F = function (x, y, z) {\n return (x & y) | ((~x) & z)\n }\n var _G = function (x, y, z) {\n return (x & z) | (y & (~z))\n }\n var _H = function (x, y, z) {\n return (x ^ y ^ z)\n }\n var _I = function (x, y, z) {\n return (y ^ (x | (~z)))\n }\n\n var _FF = function (a, b, c, d, x, s, ac) {\n a = _addUnsigned(a, _addUnsigned(_addUnsigned(_F(b, c, d), x), ac))\n return _addUnsigned(_rotateLeft(a, s), b)\n }\n\n var _GG = function (a, b, c, d, x, s, ac) {\n a = _addUnsigned(a, _addUnsigned(_addUnsigned(_G(b, c, d), x), ac))\n return _addUnsigned(_rotateLeft(a, s), b)\n }\n\n var _HH = function (a, b, c, d, x, s, ac) {\n a = _addUnsigned(a, _addUnsigned(_addUnsigned(_H(b, c, d), x), ac))\n return _addUnsigned(_rotateLeft(a, s), b)\n }\n\n var _II = function (a, b, c, d, x, s, ac) {\n a = _addUnsigned(a, _addUnsigned(_addUnsigned(_I(b, c, d), x), ac))\n return _addUnsigned(_rotateLeft(a, s), b)\n }\n\n var _convertToWordArray = function (str) {\n var lWordCount\n var lMessageLength = str.length\n var lNumberOfWordsTemp1 = lMessageLength + 8\n var lNumberOfWordsTemp2 = (lNumberOfWordsTemp1 - (lNumberOfWordsTemp1 % 64)) / 64\n var lNumberOfWords = (lNumberOfWordsTemp2 + 1) * 16\n var lWordArray = new Array(lNumberOfWords - 1)\n var lBytePosition = 0\n var lByteCount = 0\n while (lByteCount < lMessageLength) {\n lWordCount = (lByteCount - (lByteCount % 4)) / 4\n lBytePosition = (lByteCount % 4) * 8\n lWordArray[lWordCount] = (lWordArray[lWordCount] |\n (str.charCodeAt(lByteCount) << lBytePosition))\n lByteCount++\n }\n lWordCount = (lByteCount - (lByteCount % 4)) / 4\n lBytePosition = (lByteCount % 4) * 8\n lWordArray[lWordCount] = lWordArray[lWordCount] | (0x80 << lBytePosition)\n lWordArray[lNumberOfWords - 2] = lMessageLength << 3\n lWordArray[lNumberOfWords - 1] = lMessageLength >>> 29\n return lWordArray\n }\n\n var _wordToHex = function (lValue) {\n var wordToHexValue = ''\n var wordToHexValueTemp = ''\n var lByte\n var lCount\n\n for (lCount = 0; lCount <= 3; lCount++) {\n lByte = (lValue >>> (lCount * 8)) & 255\n wordToHexValueTemp = '0' + lByte.toString(16)\n wordToHexValue = wordToHexValue + wordToHexValueTemp.substr(wordToHexValueTemp.length - 2, 2)\n }\n return wordToHexValue\n }\n\n var x = []\n var k\n var AA\n var BB\n var CC\n var DD\n var a\n var b\n var c\n var d\n var S11 = 7\n var S12 = 12\n var S13 = 17\n var S14 = 22\n var S21 = 5\n var S22 = 9\n var S23 = 14\n var S24 = 20\n var S31 = 4\n var S32 = 11\n var S33 = 16\n var S34 = 23\n var S41 = 6\n var S42 = 10\n var S43 = 15\n var S44 = 21\n\n str = utf8Encode(str)\n x = _convertToWordArray(str)\n a = 0x67452301\n b = 0xEFCDAB89\n c = 0x98BADCFE\n d = 0x10325476\n\n xl = x.length\n for (k = 0; k < xl; k += 16) {\n AA = a\n BB = b\n CC = c\n DD = d\n a = _FF(a, b, c, d, x[k + 0], S11, 0xD76AA478)\n d = _FF(d, a, b, c, x[k + 1], S12, 0xE8C7B756)\n c = _FF(c, d, a, b, x[k + 2], S13, 0x242070DB)\n b = _FF(b, c, d, a, x[k + 3], S14, 0xC1BDCEEE)\n a = _FF(a, b, c, d, x[k + 4], S11, 0xF57C0FAF)\n d = _FF(d, a, b, c, x[k + 5], S12, 0x4787C62A)\n c = _FF(c, d, a, b, x[k + 6], S13, 0xA8304613)\n b = _FF(b, c, d, a, x[k + 7], S14, 0xFD469501)\n a = _FF(a, b, c, d, x[k + 8], S11, 0x698098D8)\n d = _FF(d, a, b, c, x[k + 9], S12, 0x8B44F7AF)\n c = _FF(c, d, a, b, x[k + 10], S13, 0xFFFF5BB1)\n b = _FF(b, c, d, a, x[k + 11], S14, 0x895CD7BE)\n a = _FF(a, b, c, d, x[k + 12], S11, 0x6B901122)\n d = _FF(d, a, b, c, x[k + 13], S12, 0xFD987193)\n c = _FF(c, d, a, b, x[k + 14], S13, 0xA679438E)\n b = _FF(b, c, d, a, x[k + 15], S14, 0x49B40821)\n a = _GG(a, b, c, d, x[k + 1], S21, 0xF61E2562)\n d = _GG(d, a, b, c, x[k + 6], S22, 0xC040B340)\n c = _GG(c, d, a, b, x[k + 11], S23, 0x265E5A51)\n b = _GG(b, c, d, a, x[k + 0], S24, 0xE9B6C7AA)\n a = _GG(a, b, c, d, x[k + 5], S21, 0xD62F105D)\n d = _GG(d, a, b, c, x[k + 10], S22, 0x2441453)\n c = _GG(c, d, a, b, x[k + 15], S23, 0xD8A1E681)\n b = _GG(b, c, d, a, x[k + 4], S24, 0xE7D3FBC8)\n a = _GG(a, b, c, d, x[k + 9], S21, 0x21E1CDE6)\n d = _GG(d, a, b, c, x[k + 14], S22, 0xC33707D6)\n c = _GG(c, d, a, b, x[k + 3], S23, 0xF4D50D87)\n b = _GG(b, c, d, a, x[k + 8], S24, 0x455A14ED)\n a = _GG(a, b, c, d, x[k + 13], S21, 0xA9E3E905)\n d = _GG(d, a, b, c, x[k + 2], S22, 0xFCEFA3F8)\n c = _GG(c, d, a, b, x[k + 7], S23, 0x676F02D9)\n b = _GG(b, c, d, a, x[k + 12], S24, 0x8D2A4C8A)\n a = _HH(a, b, c, d, x[k + 5], S31, 0xFFFA3942)\n d = _HH(d, a, b, c, x[k + 8], S32, 0x8771F681)\n c = _HH(c, d, a, b, x[k + 11], S33, 0x6D9D6122)\n b = _HH(b, c, d, a, x[k + 14], S34, 0xFDE5380C)\n a = _HH(a, b, c, d, x[k + 1], S31, 0xA4BEEA44)\n d = _HH(d, a, b, c, x[k + 4], S32, 0x4BDECFA9)\n c = _HH(c, d, a, b, x[k + 7], S33, 0xF6BB4B60)\n b = _HH(b, c, d, a, x[k + 10], S34, 0xBEBFBC70)\n a = _HH(a, b, c, d, x[k + 13], S31, 0x289B7EC6)\n d = _HH(d, a, b, c, x[k + 0], S32, 0xEAA127FA)\n c = _HH(c, d, a, b, x[k + 3], S33, 0xD4EF3085)\n b = _HH(b, c, d, a, x[k + 6], S34, 0x4881D05)\n a = _HH(a, b, c, d, x[k + 9], S31, 0xD9D4D039)\n d = _HH(d, a, b, c, x[k + 12], S32, 0xE6DB99E5)\n c = _HH(c, d, a, b, x[k + 15], S33, 0x1FA27CF8)\n b = _HH(b, c, d, a, x[k + 2], S34, 0xC4AC5665)\n a = _II(a, b, c, d, x[k + 0], S41, 0xF4292244)\n d = _II(d, a, b, c, x[k + 7], S42, 0x432AFF97)\n c = _II(c, d, a, b, x[k + 14], S43, 0xAB9423A7)\n b = _II(b, c, d, a, x[k + 5], S44, 0xFC93A039)\n a = _II(a, b, c, d, x[k + 12], S41, 0x655B59C3)\n d = _II(d, a, b, c, x[k + 3], S42, 0x8F0CCC92)\n c = _II(c, d, a, b, x[k + 10], S43, 0xFFEFF47D)\n b = _II(b, c, d, a, x[k + 1], S44, 0x85845DD1)\n a = _II(a, b, c, d, x[k + 8], S41, 0x6FA87E4F)\n d = _II(d, a, b, c, x[k + 15], S42, 0xFE2CE6E0)\n c = _II(c, d, a, b, x[k + 6], S43, 0xA3014314)\n b = _II(b, c, d, a, x[k + 13], S44, 0x4E0811A1)\n a = _II(a, b, c, d, x[k + 4], S41, 0xF7537E82)\n d = _II(d, a, b, c, x[k + 11], S42, 0xBD3AF235)\n c = _II(c, d, a, b, x[k + 2], S43, 0x2AD7D2BB)\n b = _II(b, c, d, a, x[k + 9], S44, 0xEB86D391)\n a = _addUnsigned(a, AA)\n b = _addUnsigned(b, BB)\n c = _addUnsigned(c, CC)\n d = _addUnsigned(d, DD)\n }\n\n var temp = _wordToHex(a) + _wordToHex(b) + _wordToHex(c) + _wordToHex(d)\n\n return temp.toLowerCase()\n}\n"]}
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/md5_file.js b/node_modules/locutus/php/strings/md5_file.js new file mode 100644 index 0000000..022069e --- /dev/null +++ b/node_modules/locutus/php/strings/md5_file.js @@ -0,0 +1,26 @@ +'use strict'; + +module.exports = function md5_file(str_filename) { + // eslint-disable-line camelcase + // discuss at: http://locutus.io/php/md5_file/ + // original by: Kevin van Zonneveld (http://kvz.io) + // input by: Brett Zamir (http://brett-zamir.me) + // bugfixed by: Kevin van Zonneveld (http://kvz.io) + // note 1: Relies on file_get_contents which does not work in the browser, so Node only. + // note 2: Keep in mind that in accordance with PHP, the whole file is buffered and then + // note 2: hashed. We'd recommend Node's native crypto modules for faster and more + // note 2: efficient hashing + // example 1: md5_file('test/never-change.txt') + // returns 1: 'bc3aa724b0ec7dce4c26e7f4d0d9b064' + + var fileGetContents = require('../filesystem/file_get_contents'); + var md5 = require('../strings/md5'); + var buf = fileGetContents(str_filename); + + if (buf === false) { + return false; + } + + return md5(buf); +}; +//# sourceMappingURL=md5_file.js.map
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/md5_file.js.map b/node_modules/locutus/php/strings/md5_file.js.map new file mode 100644 index 0000000..a662dd3 --- /dev/null +++ b/node_modules/locutus/php/strings/md5_file.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/php/strings/md5_file.js"],"names":["module","exports","md5_file","str_filename","fileGetContents","require","md5","buf"],"mappings":";;AAAAA,OAAOC,OAAP,GAAiB,SAASC,QAAT,CAAmBC,YAAnB,EAAiC;AAAE;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,MAAIC,kBAAkBC,QAAQ,iCAAR,CAAtB;AACA,MAAIC,MAAMD,QAAQ,gBAAR,CAAV;AACA,MAAIE,MAAMH,gBAAgBD,YAAhB,CAAV;;AAEA,MAAII,QAAQ,KAAZ,EAAmB;AACjB,WAAO,KAAP;AACD;;AAED,SAAOD,IAAIC,GAAJ,CAAP;AACD,CArBD","file":"md5_file.js","sourcesContent":["module.exports = function md5_file (str_filename) { // eslint-disable-line camelcase\n // discuss at: http://locutus.io/php/md5_file/\n // original by: Kevin van Zonneveld (http://kvz.io)\n // input by: Brett Zamir (http://brett-zamir.me)\n // bugfixed by: Kevin van Zonneveld (http://kvz.io)\n // note 1: Relies on file_get_contents which does not work in the browser, so Node only.\n // note 2: Keep in mind that in accordance with PHP, the whole file is buffered and then\n // note 2: hashed. We'd recommend Node's native crypto modules for faster and more\n // note 2: efficient hashing\n // example 1: md5_file('test/never-change.txt')\n // returns 1: 'bc3aa724b0ec7dce4c26e7f4d0d9b064'\n\n var fileGetContents = require('../filesystem/file_get_contents')\n var md5 = require('../strings/md5')\n var buf = fileGetContents(str_filename)\n\n if (buf === false) {\n return false\n }\n\n return md5(buf)\n}\n"]}
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/metaphone.js b/node_modules/locutus/php/strings/metaphone.js new file mode 100644 index 0000000..09117ef --- /dev/null +++ b/node_modules/locutus/php/strings/metaphone.js @@ -0,0 +1,227 @@ +'use strict'; + +var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; + +module.exports = function metaphone(word, maxPhonemes) { + // discuss at: http://locutus.io/php/metaphone/ + // original by: Greg Frazier + // improved by: Brett Zamir (http://brett-zamir.me) + // improved by: Rafał Kukawski (http://blog.kukawski.pl) + // example 1: metaphone('Gnu') + // returns 1: 'N' + // example 2: metaphone('bigger') + // returns 2: 'BKR' + // example 3: metaphone('accuracy') + // returns 3: 'AKKRS' + // example 4: metaphone('batch batcher') + // returns 4: 'BXBXR' + + var type = typeof word === 'undefined' ? 'undefined' : _typeof(word); + + if (type === 'undefined' || type === 'object' && word !== null) { + // weird! + return null; + } + + // infinity and NaN values are treated as strings + if (type === 'number') { + if (isNaN(word)) { + word = 'NAN'; + } else if (!isFinite(word)) { + word = 'INF'; + } + } + + if (maxPhonemes < 0) { + return false; + } + + maxPhonemes = Math.floor(+maxPhonemes) || 0; + + // alpha depends on locale, so this var might need an update + // or should be turned into a regex + // for now assuming pure a-z + var alpha = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'; + var vowel = 'AEIOU'; + var soft = 'EIY'; + var leadingNonAlpha = new RegExp('^[^' + alpha + ']+'); + + word = typeof word === 'string' ? word : ''; + word = word.toUpperCase().replace(leadingNonAlpha, ''); + + if (!word) { + return ''; + } + + var is = function is(p, c) { + return c !== '' && p.indexOf(c) !== -1; + }; + + var i = 0; + var cc = word.charAt(0); // current char. Short name because it's used all over the function + var nc = word.charAt(1); // next char + var nnc; // after next char + var pc; // previous char + var l = word.length; + var meta = ''; + // traditional is an internal param that could be exposed for now let it be a local var + var traditional = true; + + switch (cc) { + case 'A': + meta += nc === 'E' ? nc : cc; + i += 1; + break; + case 'G': + case 'K': + case 'P': + if (nc === 'N') { + meta += nc; + i += 2; + } + break; + case 'W': + if (nc === 'R') { + meta += nc; + i += 2; + } else if (nc === 'H' || is(vowel, nc)) { + meta += 'W'; + i += 2; + } + break; + case 'X': + meta += 'S'; + i += 1; + break; + case 'E': + case 'I': + case 'O': + case 'U': + meta += cc; + i++; + break; + } + + for (; i < l && (maxPhonemes === 0 || meta.length < maxPhonemes); i += 1) { + // eslint-disable-line no-unmodified-loop-condition,max-len + cc = word.charAt(i); + nc = word.charAt(i + 1); + pc = word.charAt(i - 1); + nnc = word.charAt(i + 2); + + if (cc === pc && cc !== 'C') { + continue; + } + + switch (cc) { + case 'B': + if (pc !== 'M') { + meta += cc; + } + break; + case 'C': + if (is(soft, nc)) { + if (nc === 'I' && nnc === 'A') { + meta += 'X'; + } else if (pc !== 'S') { + meta += 'S'; + } + } else if (nc === 'H') { + meta += !traditional && (nnc === 'R' || pc === 'S') ? 'K' : 'X'; + i += 1; + } else { + meta += 'K'; + } + break; + case 'D': + if (nc === 'G' && is(soft, nnc)) { + meta += 'J'; + i += 1; + } else { + meta += 'T'; + } + break; + case 'G': + if (nc === 'H') { + if (!(is('BDH', word.charAt(i - 3)) || word.charAt(i - 4) === 'H')) { + meta += 'F'; + i += 1; + } + } else if (nc === 'N') { + if (is(alpha, nnc) && word.substr(i + 1, 3) !== 'NED') { + meta += 'K'; + } + } else if (is(soft, nc) && pc !== 'G') { + meta += 'J'; + } else { + meta += 'K'; + } + break; + case 'H': + if (is(vowel, nc) && !is('CGPST', pc)) { + meta += cc; + } + break; + case 'K': + if (pc !== 'C') { + meta += 'K'; + } + break; + case 'P': + meta += nc === 'H' ? 'F' : cc; + break; + case 'Q': + meta += 'K'; + break; + case 'S': + if (nc === 'I' && is('AO', nnc)) { + meta += 'X'; + } else if (nc === 'H') { + meta += 'X'; + i += 1; + } else if (!traditional && word.substr(i + 1, 3) === 'CHW') { + meta += 'X'; + i += 2; + } else { + meta += 'S'; + } + break; + case 'T': + if (nc === 'I' && is('AO', nnc)) { + meta += 'X'; + } else if (nc === 'H') { + meta += '0'; + i += 1; + } else if (word.substr(i + 1, 2) !== 'CH') { + meta += 'T'; + } + break; + case 'V': + meta += 'F'; + break; + case 'W': + case 'Y': + if (is(vowel, nc)) { + meta += cc; + } + break; + case 'X': + meta += 'KS'; + break; + case 'Z': + meta += 'S'; + break; + case 'F': + case 'J': + case 'L': + case 'M': + case 'N': + case 'R': + meta += cc; + break; + } + } + + return meta; +}; +//# sourceMappingURL=metaphone.js.map
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/metaphone.js.map b/node_modules/locutus/php/strings/metaphone.js.map new file mode 100644 index 0000000..4882abc --- /dev/null +++ b/node_modules/locutus/php/strings/metaphone.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/php/strings/metaphone.js"],"names":["module","exports","metaphone","word","maxPhonemes","type","isNaN","isFinite","Math","floor","alpha","vowel","soft","leadingNonAlpha","RegExp","toUpperCase","replace","is","p","c","indexOf","i","cc","charAt","nc","nnc","pc","l","length","meta","traditional","substr"],"mappings":";;;;AAAAA,OAAOC,OAAP,GAAiB,SAASC,SAAT,CAAoBC,IAApB,EAA0BC,WAA1B,EAAuC;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,MAAIC,cAAcF,IAAd,yCAAcA,IAAd,CAAJ;;AAEA,MAAIE,SAAS,WAAT,IAAwBA,SAAS,QAAT,IAAqBF,SAAS,IAA1D,EAAgE;AAC9D;AACA,WAAO,IAAP;AACD;;AAED;AACA,MAAIE,SAAS,QAAb,EAAuB;AACrB,QAAIC,MAAMH,IAAN,CAAJ,EAAiB;AACfA,aAAO,KAAP;AACD,KAFD,MAEO,IAAI,CAACI,SAASJ,IAAT,CAAL,EAAqB;AAC1BA,aAAO,KAAP;AACD;AACF;;AAED,MAAIC,cAAc,CAAlB,EAAqB;AACnB,WAAO,KAAP;AACD;;AAEDA,gBAAcI,KAAKC,KAAL,CAAW,CAACL,WAAZ,KAA4B,CAA1C;;AAEA;AACA;AACA;AACA,MAAIM,QAAQ,4BAAZ;AACA,MAAIC,QAAQ,OAAZ;AACA,MAAIC,OAAO,KAAX;AACA,MAAIC,kBAAkB,IAAIC,MAAJ,CAAW,QAAQJ,KAAR,GAAgB,IAA3B,CAAtB;;AAEAP,SAAO,OAAOA,IAAP,KAAgB,QAAhB,GAA2BA,IAA3B,GAAkC,EAAzC;AACAA,SAAOA,KAAKY,WAAL,GAAmBC,OAAnB,CAA2BH,eAA3B,EAA4C,EAA5C,CAAP;;AAEA,MAAI,CAACV,IAAL,EAAW;AACT,WAAO,EAAP;AACD;;AAED,MAAIc,KAAK,SAALA,EAAK,CAAUC,CAAV,EAAa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;AACD,SAHM,MAGA,IAAIlB,KAAK4B,MAAL,CAAYV,IAAI,CAAhB,EAAmB,CAAnB,MAA0B,IAA9B,EAAoC;AACzCQ,kBAAQ,GAAR;AACD;AACD;AACF,WAAK,GAAL;AACEA,gBAAQ,GAAR;AACA;AACF,WAAK,GAAL;AACA,WAAK,GAAL;AACE,YAAIZ,GAAGN,KAAH,EAAUa,EAAV,CAAJ,EAAmB;AACjBK,kBAAQP,EAAR;AACD;AACD;AACF,WAAK,GAAL;AACEO,gBAAQ,IAAR;AACA;AACF,WAAK,GAAL;AACEA,gBAAQ,GAAR;AACA;AACF,WAAK,GAAL;AACA,WAAK,GAAL;AACA,WAAK,GAAL;AACA,WAAK,GAAL;AACA,WAAK,GAAL;AACA,WAAK,GAAL;AACEA,gBAAQP,EAAR;AACA;AAzGJ;AA2GD;;AAED,SAAOO,IAAP;AACD,CA5ND","file":"metaphone.js","sourcesContent":["module.exports = function metaphone (word, maxPhonemes) {\n // discuss at: http://locutus.io/php/metaphone/\n // original by: Greg Frazier\n // improved by: Brett Zamir (http://brett-zamir.me)\n // improved by: Rafał Kukawski (http://blog.kukawski.pl)\n // example 1: metaphone('Gnu')\n // returns 1: 'N'\n // example 2: metaphone('bigger')\n // returns 2: 'BKR'\n // example 3: metaphone('accuracy')\n // returns 3: 'AKKRS'\n // example 4: metaphone('batch batcher')\n // returns 4: 'BXBXR'\n\n var type = typeof word\n\n if (type === 'undefined' || type === 'object' && word !== null) {\n // weird!\n return null\n }\n\n // infinity and NaN values are treated as strings\n if (type === 'number') {\n if (isNaN(word)) {\n word = 'NAN'\n } else if (!isFinite(word)) {\n word = 'INF'\n }\n }\n\n if (maxPhonemes < 0) {\n return false\n }\n\n maxPhonemes = Math.floor(+maxPhonemes) || 0\n\n // alpha depends on locale, so this var might need an update\n // or should be turned into a regex\n // for now assuming pure a-z\n var alpha = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'\n var vowel = 'AEIOU'\n var soft = 'EIY'\n var leadingNonAlpha = new RegExp('^[^' + alpha + ']+')\n\n word = typeof word === 'string' ? word : ''\n word = word.toUpperCase().replace(leadingNonAlpha, '')\n\n if (!word) {\n return ''\n }\n\n var is = function (p, c) {\n return c !== '' && p.indexOf(c) !== -1\n }\n\n var i = 0\n var cc = word.charAt(0) // current char. Short name because it's used all over the function\n var nc = word.charAt(1) // next char\n var nnc // after next char\n var pc // previous char\n var l = word.length\n var meta = ''\n // traditional is an internal param that could be exposed for now let it be a local var\n var traditional = true\n\n switch (cc) {\n case 'A':\n meta += nc === 'E' ? nc : cc\n i += 1\n break\n case 'G':\n case 'K':\n case 'P':\n if (nc === 'N') {\n meta += nc\n i += 2\n }\n break\n case 'W':\n if (nc === 'R') {\n meta += nc\n i += 2\n } else if (nc === 'H' || is(vowel, nc)) {\n meta += 'W'\n i += 2\n }\n break\n case 'X':\n meta += 'S'\n i += 1\n break\n case 'E':\n case 'I':\n case 'O':\n case 'U':\n meta += cc\n i++\n break\n }\n\n for (; i < l && (maxPhonemes === 0 || meta.length < maxPhonemes); i += 1) { // eslint-disable-line no-unmodified-loop-condition,max-len\n cc = word.charAt(i)\n nc = word.charAt(i + 1)\n pc = word.charAt(i - 1)\n nnc = word.charAt(i + 2)\n\n if (cc === pc && cc !== 'C') {\n continue\n }\n\n switch (cc) {\n case 'B':\n if (pc !== 'M') {\n meta += cc\n }\n break\n case 'C':\n if (is(soft, nc)) {\n if (nc === 'I' && nnc === 'A') {\n meta += 'X'\n } else if (pc !== 'S') {\n meta += 'S'\n }\n } else if (nc === 'H') {\n meta += !traditional && (nnc === 'R' || pc === 'S') ? 'K' : 'X'\n i += 1\n } else {\n meta += 'K'\n }\n break\n case 'D':\n if (nc === 'G' && is(soft, nnc)) {\n meta += 'J'\n i += 1\n } else {\n meta += 'T'\n }\n break\n case 'G':\n if (nc === 'H') {\n if (!(is('BDH', word.charAt(i - 3)) || word.charAt(i - 4) === 'H')) {\n meta += 'F'\n i += 1\n }\n } else if (nc === 'N') {\n if (is(alpha, nnc) && word.substr(i + 1, 3) !== 'NED') {\n meta += 'K'\n }\n } else if (is(soft, nc) && pc !== 'G') {\n meta += 'J'\n } else {\n meta += 'K'\n }\n break\n case 'H':\n if (is(vowel, nc) && !is('CGPST', pc)) {\n meta += cc\n }\n break\n case 'K':\n if (pc !== 'C') {\n meta += 'K'\n }\n break\n case 'P':\n meta += nc === 'H' ? 'F' : cc\n break\n case 'Q':\n meta += 'K'\n break\n case 'S':\n if (nc === 'I' && is('AO', nnc)) {\n meta += 'X'\n } else if (nc === 'H') {\n meta += 'X'\n i += 1\n } else if (!traditional && word.substr(i + 1, 3) === 'CHW') {\n meta += 'X'\n i += 2\n } else {\n meta += 'S'\n }\n break\n case 'T':\n if (nc === 'I' && is('AO', nnc)) {\n meta += 'X'\n } else if (nc === 'H') {\n meta += '0'\n i += 1\n } else if (word.substr(i + 1, 2) !== 'CH') {\n meta += 'T'\n }\n break\n case 'V':\n meta += 'F'\n break\n case 'W':\n case 'Y':\n if (is(vowel, nc)) {\n meta += cc\n }\n break\n case 'X':\n meta += 'KS'\n break\n case 'Z':\n meta += 'S'\n break\n case 'F':\n case 'J':\n case 'L':\n case 'M':\n case 'N':\n case 'R':\n meta += cc\n break\n }\n }\n\n return meta\n}\n"]}
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/money_format.js b/node_modules/locutus/php/strings/money_format.js new file mode 100644 index 0000000..80f78f9 --- /dev/null +++ b/node_modules/locutus/php/strings/money_format.js @@ -0,0 +1,252 @@ +'use strict'; + +module.exports = function money_format(format, number) { + // eslint-disable-line camelcase + // discuss at: http://locutus.io/php/money_format/ + // original by: Brett Zamir (http://brett-zamir.me) + // input by: daniel airton wermann (http://wermann.com.br) + // bugfixed by: Brett Zamir (http://brett-zamir.me) + // note 1: This depends on setlocale having the appropriate + // note 1: locale (these examples use 'en_US') + // example 1: money_format('%i', 1234.56) + // returns 1: ' USD 1,234.56' + // example 2: money_format('%14#8.2n', 1234.5678) + // returns 2: ' $ 1,234.57' + // example 3: money_format('%14#8.2n', -1234.5678) + // returns 3: '-$ 1,234.57' + // example 4: money_format('%(14#8.2n', 1234.5678) + // returns 4: ' $ 1,234.57 ' + // example 5: money_format('%(14#8.2n', -1234.5678) + // returns 5: '($ 1,234.57)' + // example 6: money_format('%=014#8.2n', 1234.5678) + // returns 6: ' $000001,234.57' + // example 7: money_format('%=014#8.2n', -1234.5678) + // returns 7: '-$000001,234.57' + // example 8: money_format('%=*14#8.2n', 1234.5678) + // returns 8: ' $*****1,234.57' + // example 9: money_format('%=*14#8.2n', -1234.5678) + // returns 9: '-$*****1,234.57' + // example 10: money_format('%=*^14#8.2n', 1234.5678) + // returns 10: ' $****1234.57' + // example 11: money_format('%=*^14#8.2n', -1234.5678) + // returns 11: ' -$****1234.57' + // example 12: money_format('%=*!14#8.2n', 1234.5678) + // returns 12: ' *****1,234.57' + // example 13: money_format('%=*!14#8.2n', -1234.5678) + // returns 13: '-*****1,234.57' + // example 14: money_format('%i', 3590) + // returns 14: ' USD 3,590.00' + + var setlocale = require('../strings/setlocale'); + + // Per PHP behavior, there seems to be no extra padding + // for sign when there is a positive number, though my + // understanding of the description is that there should be padding; + // need to revisit examples + + // Helpful info at http://ftp.gnu.org/pub/pub/old-gnu/Manuals/glibc-2.2.3/html_chapter/libc_7.html + // and http://publib.boulder.ibm.com/infocenter/zos/v1r10/index.jsp?topic=/com.ibm.zos.r10.bpxbd00/strfmp.htm + + if (typeof number !== 'number') { + return null; + } + // 1: flags, 3: width, 5: left, 7: right, 8: conversion + var regex = /%((=.|[+^(!-])*?)(\d*?)(#(\d+))?(\.(\d+))?([in%])/g; + + // Ensure the locale data we need is set up + setlocale('LC_ALL', 0); + + var $global = typeof window !== 'undefined' ? window : global; + $global.$locutus = $global.$locutus || {}; + var $locutus = $global.$locutus; + $locutus.php = $locutus.php || {}; + + var monetary = $locutus.php.locales[$locutus.php.localeCategories.LC_MONETARY].LC_MONETARY; + + var doReplace = function doReplace(n0, flags, n2, width, n4, left, n6, right, conversion) { + var value = ''; + var repl = ''; + if (conversion === '%') { + // Percent does not seem to be allowed with intervening content + return '%'; + } + var fill = flags && /=./.test(flags) ? flags.match(/=(.)/)[1] : ' '; // flag: =f (numeric fill) + // flag: ! (suppress currency symbol) + var showCurrSymbol = !flags || flags.indexOf('!') === -1; + // field width: w (minimum field width) + width = parseInt(width, 10) || 0; + + var neg = number < 0; + // Convert to string + number = number + ''; + // We don't want negative symbol represented here yet + number = neg ? number.slice(1) : number; + + var decpos = number.indexOf('.'); + // Get integer portion + var integer = decpos !== -1 ? number.slice(0, decpos) : number; + // Get decimal portion + var fraction = decpos !== -1 ? number.slice(decpos + 1) : ''; + + var _strSplice = function _strSplice(integerStr, idx, thouSep) { + var integerArr = integerStr.split(''); + integerArr.splice(idx, 0, thouSep); + return integerArr.join(''); + }; + + var intLen = integer.length; + left = parseInt(left, 10); + var filler = intLen < left; + if (filler) { + var fillnum = left - intLen; + integer = new Array(fillnum + 1).join(fill) + integer; + } + if (flags.indexOf('^') === -1) { + // flag: ^ (disable grouping characters (of locale)) + // use grouping characters + // ',' + var thouSep = monetary.mon_thousands_sep; + // [3] (every 3 digits in U.S.A. locale) + var monGrouping = monetary.mon_grouping; + + if (monGrouping[0] < integer.length) { + for (var i = 0, idx = integer.length; i < monGrouping.length; i++) { + // e.g., 3 + idx -= monGrouping[i]; + if (idx <= 0) { + break; + } + if (filler && idx < fillnum) { + thouSep = fill; + } + integer = _strSplice(integer, idx, thouSep); + } + } + if (monGrouping[i - 1] > 0) { + // Repeating last grouping (may only be one) until highest portion of integer reached + while (idx > monGrouping[i - 1]) { + idx -= monGrouping[i - 1]; + if (filler && idx < fillnum) { + thouSep = fill; + } + integer = _strSplice(integer, idx, thouSep); + } + } + } + + // left, right + if (right === '0') { + // No decimal or fractional digits + value = integer; + } else { + // '.' + var decPt = monetary.mon_decimal_point; + if (right === '' || right === undefined) { + right = conversion === 'i' ? monetary.int_frac_digits : monetary.frac_digits; + } + right = parseInt(right, 10); + + if (right === 0) { + // Only remove fractional portion if explicitly set to zero digits + fraction = ''; + decPt = ''; + } else if (right < fraction.length) { + fraction = Math.round(parseFloat(fraction.slice(0, right) + '.' + fraction.substr(right, 1))); + if (right > fraction.length) { + fraction = new Array(right - fraction.length + 1).join('0') + fraction; // prepend with 0's + } + } else if (right > fraction.length) { + fraction += new Array(right - fraction.length + 1).join('0'); // pad with 0's + } + value = integer + decPt + fraction; + } + + var symbol = ''; + if (showCurrSymbol) { + // 'i' vs. 'n' ('USD' vs. '$') + symbol = conversion === 'i' ? monetary.int_curr_symbol : monetary.currency_symbol; + } + var signPosn = neg ? monetary.n_sign_posn : monetary.p_sign_posn; + + // 0: no space between curr. symbol and value + // 1: space sep. them unless symb. and sign are adjacent then space sep. them from value + // 2: space sep. sign and value unless symb. and sign are adjacent then space separates + var sepBySpace = neg ? monetary.n_sep_by_space : monetary.p_sep_by_space; + + // p_cs_precedes, n_cs_precedes + // positive currency symbol follows value = 0; precedes value = 1 + var csPrecedes = neg ? monetary.n_cs_precedes : monetary.p_cs_precedes; + + // Assemble symbol/value/sign and possible space as appropriate + if (flags.indexOf('(') !== -1) { + // flag: parenth. for negative + // @todo: unclear on whether and how sepBySpace, signPosn, or csPrecedes have + // an impact here (as they do below), but assuming for now behaves as signPosn 0 as + // far as localized sepBySpace and signPosn behavior + repl = (csPrecedes ? symbol + (sepBySpace === 1 ? ' ' : '') : '') + value + (!csPrecedes ? (sepBySpace === 1 ? ' ' : '') + symbol : ''); + if (neg) { + repl = '(' + repl + ')'; + } else { + repl = ' ' + repl + ' '; + } + } else { + // '+' is default + // '' + var posSign = monetary.positive_sign; + // '-' + var negSign = monetary.negative_sign; + var sign = neg ? negSign : posSign; + var otherSign = neg ? posSign : negSign; + var signPadding = ''; + if (signPosn) { + // has a sign + signPadding = new Array(otherSign.length - sign.length + 1).join(' '); + } + + var valueAndCS = ''; + switch (signPosn) { + // 0: parentheses surround value and curr. symbol; + // 1: sign precedes them; + // 2: sign follows them; + // 3: sign immed. precedes curr. symbol; (but may be space between) + // 4: sign immed. succeeds curr. symbol; (but may be space between) + case 0: + valueAndCS = csPrecedes ? symbol + (sepBySpace === 1 ? ' ' : '') + value : value + (sepBySpace === 1 ? ' ' : '') + symbol; + repl = '(' + valueAndCS + ')'; + break; + case 1: + valueAndCS = csPrecedes ? symbol + (sepBySpace === 1 ? ' ' : '') + value : value + (sepBySpace === 1 ? ' ' : '') + symbol; + repl = signPadding + sign + (sepBySpace === 2 ? ' ' : '') + valueAndCS; + break; + case 2: + valueAndCS = csPrecedes ? symbol + (sepBySpace === 1 ? ' ' : '') + value : value + (sepBySpace === 1 ? ' ' : '') + symbol; + repl = valueAndCS + (sepBySpace === 2 ? ' ' : '') + sign + signPadding; + break; + case 3: + repl = csPrecedes ? signPadding + sign + (sepBySpace === 2 ? ' ' : '') + symbol + (sepBySpace === 1 ? ' ' : '') + value : value + (sepBySpace === 1 ? ' ' : '') + sign + signPadding + (sepBySpace === 2 ? ' ' : '') + symbol; + break; + case 4: + repl = csPrecedes ? symbol + (sepBySpace === 2 ? ' ' : '') + signPadding + sign + (sepBySpace === 1 ? ' ' : '') + value : value + (sepBySpace === 1 ? ' ' : '') + symbol + (sepBySpace === 2 ? ' ' : '') + sign + signPadding; + break; + } + } + + var padding = width - repl.length; + if (padding > 0) { + padding = new Array(padding + 1).join(' '); + // @todo: How does p_sep_by_space affect the count if there is a space? + // Included in count presumably? + if (flags.indexOf('-') !== -1) { + // left-justified (pad to right) + repl += padding; + } else { + // right-justified (pad to left) + repl = padding + repl; + } + } + return repl; + }; + + return format.replace(regex, doReplace); +}; +//# sourceMappingURL=money_format.js.map
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/money_format.js.map b/node_modules/locutus/php/strings/money_format.js.map new file mode 100644 index 0000000..0a99628 --- /dev/null +++ b/node_modules/locutus/php/strings/money_format.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/php/strings/money_format.js"],"names":["module","exports","money_format","format","number","setlocale","require","regex","$global","window","global","$locutus","php","monetary","locales","localeCategories","LC_MONETARY","doReplace","n0","flags","n2","width","n4","left","n6","right","conversion","value","repl","fill","test","match","showCurrSymbol","indexOf","parseInt","neg","slice","decpos","integer","fraction","_strSplice","integerStr","idx","thouSep","integerArr","split","splice","join","intLen","length","filler","fillnum","Array","mon_thousands_sep","monGrouping","mon_grouping","i","decPt","mon_decimal_point","undefined","int_frac_digits","frac_digits","Math","round","parseFloat","substr","symbol","int_curr_symbol","currency_symbol","signPosn","n_sign_posn","p_sign_posn","sepBySpace","n_sep_by_space","p_sep_by_space","csPrecedes","n_cs_precedes","p_cs_precedes","posSign","positive_sign","negSign","negative_sign","sign","otherSign","signPadding","valueAndCS","padding","replace"],"mappings":";;AAAAA,OAAOC,OAAP,GAAiB,SAASC,YAAT,CAAuBC,MAAvB,EAA+BC,MAA/B,EAAuC;AAAE;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,MAAIC,YAAYC,QAAQ,sBAAR,CAAhB;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,MAAI,OAAOF,MAAP,KAAkB,QAAtB,EAAgC;AAC9B,WAAO,IAAP;AACD;AACD;AACA,MAAIG,QAAQ,oDAAZ;;AAEA;AACAF,YAAU,QAAV,EAAoB,CAApB;;AAEA,MAAIG,UAAW,OAAOC,MAAP,KAAkB,WAAlB,GAAgCA,MAAhC,GAAyCC,MAAxD;AACAF,UAAQG,QAAR,GAAmBH,QAAQG,QAAR,IAAoB,EAAvC;AACA,MAAIA,WAAWH,QAAQG,QAAvB;AACAA,WAASC,GAAT,GAAeD,SAASC,GAAT,IAAgB,EAA/B;;AAEA,MAAIC,WAAWF,SAASC,GAAT,CAAaE,OAAb,CAAqBH,SAASC,GAAT,CAAaG,gBAAb,CAA8BC,WAAn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AuCD;;AAED,QAAIE,UAAUjE,QAAQO,KAAKqB,MAA3B;AACA,QAAIqC,UAAU,CAAd,EAAiB;AACfA,gBAAU,IAAIlC,KAAJ,CAAUkC,UAAU,CAApB,EAAuBvC,IAAvB,CAA4B,GAA5B,CAAV;AACA;AACA;AACA,UAAI5B,MAAMc,OAAN,CAAc,GAAd,MAAuB,CAAC,CAA5B,EAA+B;AAC7B;AACAL,gBAAQ0D,OAAR;AACD,OAHD,MAGO;AACL;AACA1D,eAAO0D,UAAU1D,IAAjB;AACD;AACF;AACD,WAAOA,IAAP;AACD,GAvMD;;AAyMA,SAAOzB,OAAOoF,OAAP,CAAehF,KAAf,EAAsBU,SAAtB,CAAP;AACD,CAxQD","file":"money_format.js","sourcesContent":["module.exports = function money_format (format, number) { // eslint-disable-line camelcase\n // discuss at: http://locutus.io/php/money_format/\n // original by: Brett Zamir (http://brett-zamir.me)\n // input by: daniel airton wermann (http://wermann.com.br)\n // bugfixed by: Brett Zamir (http://brett-zamir.me)\n // note 1: This depends on setlocale having the appropriate\n // note 1: locale (these examples use 'en_US')\n // example 1: money_format('%i', 1234.56)\n // returns 1: ' USD 1,234.56'\n // example 2: money_format('%14#8.2n', 1234.5678)\n // returns 2: ' $ 1,234.57'\n // example 3: money_format('%14#8.2n', -1234.5678)\n // returns 3: '-$ 1,234.57'\n // example 4: money_format('%(14#8.2n', 1234.5678)\n // returns 4: ' $ 1,234.57 '\n // example 5: money_format('%(14#8.2n', -1234.5678)\n // returns 5: '($ 1,234.57)'\n // example 6: money_format('%=014#8.2n', 1234.5678)\n // returns 6: ' $000001,234.57'\n // example 7: money_format('%=014#8.2n', -1234.5678)\n // returns 7: '-$000001,234.57'\n // example 8: money_format('%=*14#8.2n', 1234.5678)\n // returns 8: ' $*****1,234.57'\n // example 9: money_format('%=*14#8.2n', -1234.5678)\n // returns 9: '-$*****1,234.57'\n // example 10: money_format('%=*^14#8.2n', 1234.5678)\n // returns 10: ' $****1234.57'\n // example 11: money_format('%=*^14#8.2n', -1234.5678)\n // returns 11: ' -$****1234.57'\n // example 12: money_format('%=*!14#8.2n', 1234.5678)\n // returns 12: ' *****1,234.57'\n // example 13: money_format('%=*!14#8.2n', -1234.5678)\n // returns 13: '-*****1,234.57'\n // example 14: money_format('%i', 3590)\n // returns 14: ' USD 3,590.00'\n\n var setlocale = require('../strings/setlocale')\n\n // Per PHP behavior, there seems to be no extra padding\n // for sign when there is a positive number, though my\n // understanding of the description is that there should be padding;\n // need to revisit examples\n\n // Helpful info at http://ftp.gnu.org/pub/pub/old-gnu/Manuals/glibc-2.2.3/html_chapter/libc_7.html\n // and http://publib.boulder.ibm.com/infocenter/zos/v1r10/index.jsp?topic=/com.ibm.zos.r10.bpxbd00/strfmp.htm\n\n if (typeof number !== 'number') {\n return null\n }\n // 1: flags, 3: width, 5: left, 7: right, 8: conversion\n var regex = /%((=.|[+^(!-])*?)(\\d*?)(#(\\d+))?(\\.(\\d+))?([in%])/g\n\n // Ensure the locale data we need is set up\n setlocale('LC_ALL', 0)\n\n var $global = (typeof window !== 'undefined' ? window : global)\n $global.$locutus = $global.$locutus || {}\n var $locutus = $global.$locutus\n $locutus.php = $locutus.php || {}\n\n var monetary = $locutus.php.locales[$locutus.php.localeCategories.LC_MONETARY].LC_MONETARY\n\n var doReplace = function (n0, flags, n2, width, n4, left, n6, right, conversion) {\n var value = ''\n var repl = ''\n if (conversion === '%') {\n // Percent does not seem to be allowed with intervening content\n return '%'\n }\n var fill = flags && (/=./).test(flags) ? flags.match(/=(.)/)[1] : ' ' // flag: =f (numeric fill)\n // flag: ! (suppress currency symbol)\n var showCurrSymbol = !flags || flags.indexOf('!') === -1\n // field width: w (minimum field width)\n width = parseInt(width, 10) || 0\n\n var neg = number < 0\n // Convert to string\n number = number + ''\n // We don't want negative symbol represented here yet\n number = neg ? number.slice(1) : number\n\n var decpos = number.indexOf('.')\n // Get integer portion\n var integer = decpos !== -1 ? number.slice(0, decpos) : number\n // Get decimal portion\n var fraction = decpos !== -1 ? number.slice(decpos + 1) : ''\n\n var _strSplice = function (integerStr, idx, thouSep) {\n var integerArr = integerStr.split('')\n integerArr.splice(idx, 0, thouSep)\n return integerArr.join('')\n }\n\n var intLen = integer.length\n left = parseInt(left, 10)\n var filler = intLen < left\n if (filler) {\n var fillnum = left - intLen\n integer = new Array(fillnum + 1).join(fill) + integer\n }\n if (flags.indexOf('^') === -1) {\n // flag: ^ (disable grouping characters (of locale))\n // use grouping characters\n // ','\n var thouSep = monetary.mon_thousands_sep\n // [3] (every 3 digits in U.S.A. locale)\n var monGrouping = monetary.mon_grouping\n\n if (monGrouping[0] < integer.length) {\n for (var i = 0, idx = integer.length; i < monGrouping.length; i++) {\n // e.g., 3\n idx -= monGrouping[i]\n if (idx <= 0) {\n break\n }\n if (filler && idx < fillnum) {\n thouSep = fill\n }\n integer = _strSplice(integer, idx, thouSep)\n }\n }\n if (monGrouping[i - 1] > 0) {\n // Repeating last grouping (may only be one) until highest portion of integer reached\n while (idx > monGrouping[i - 1]) {\n idx -= monGrouping[i - 1]\n if (filler && idx < fillnum) {\n thouSep = fill\n }\n integer = _strSplice(integer, idx, thouSep)\n }\n }\n }\n\n // left, right\n if (right === '0') {\n // No decimal or fractional digits\n value = integer\n } else {\n // '.'\n var decPt = monetary.mon_decimal_point\n if (right === '' || right === undefined) {\n right = conversion === 'i' ? monetary.int_frac_digits : monetary.frac_digits\n }\n right = parseInt(right, 10)\n\n if (right === 0) {\n // Only remove fractional portion if explicitly set to zero digits\n fraction = ''\n decPt = ''\n } else if (right < fraction.length) {\n fraction = Math.round(parseFloat(\n fraction.slice(0, right) + '.' + fraction.substr(right, 1)\n ))\n if (right > fraction.length) {\n fraction = new Array(right - fraction.length + 1).join('0') + fraction // prepend with 0's\n }\n } else if (right > fraction.length) {\n fraction += new Array(right - fraction.length + 1).join('0') // pad with 0's\n }\n value = integer + decPt + fraction\n }\n\n var symbol = ''\n if (showCurrSymbol) {\n // 'i' vs. 'n' ('USD' vs. '$')\n symbol = conversion === 'i' ? monetary.int_curr_symbol : monetary.currency_symbol\n }\n var signPosn = neg ? monetary.n_sign_posn : monetary.p_sign_posn\n\n // 0: no space between curr. symbol and value\n // 1: space sep. them unless symb. and sign are adjacent then space sep. them from value\n // 2: space sep. sign and value unless symb. and sign are adjacent then space separates\n var sepBySpace = neg ? monetary.n_sep_by_space : monetary.p_sep_by_space\n\n // p_cs_precedes, n_cs_precedes\n // positive currency symbol follows value = 0; precedes value = 1\n var csPrecedes = neg ? monetary.n_cs_precedes : monetary.p_cs_precedes\n\n // Assemble symbol/value/sign and possible space as appropriate\n if (flags.indexOf('(') !== -1) {\n // flag: parenth. for negative\n // @todo: unclear on whether and how sepBySpace, signPosn, or csPrecedes have\n // an impact here (as they do below), but assuming for now behaves as signPosn 0 as\n // far as localized sepBySpace and signPosn behavior\n repl = (csPrecedes ? symbol + (sepBySpace === 1 ? ' ' : '') : '') + value + (!csPrecedes ? (\n sepBySpace === 1 ? ' ' : '') + symbol : '')\n if (neg) {\n repl = '(' + repl + ')'\n } else {\n repl = ' ' + repl + ' '\n }\n } else {\n // '+' is default\n // ''\n var posSign = monetary.positive_sign\n // '-'\n var negSign = monetary.negative_sign\n var sign = neg ? (negSign) : (posSign)\n var otherSign = neg ? (posSign) : (negSign)\n var signPadding = ''\n if (signPosn) {\n // has a sign\n signPadding = new Array(otherSign.length - sign.length + 1).join(' ')\n }\n\n var valueAndCS = ''\n switch (signPosn) {\n // 0: parentheses surround value and curr. symbol;\n // 1: sign precedes them;\n // 2: sign follows them;\n // 3: sign immed. precedes curr. symbol; (but may be space between)\n // 4: sign immed. succeeds curr. symbol; (but may be space between)\n case 0:\n valueAndCS = csPrecedes\n ? symbol + (sepBySpace === 1 ? ' ' : '') + value\n : value + (sepBySpace === 1 ? ' ' : '') + symbol\n repl = '(' + valueAndCS + ')'\n break\n case 1:\n valueAndCS = csPrecedes\n ? symbol + (sepBySpace === 1 ? ' ' : '') + value\n : value + (sepBySpace === 1 ? ' ' : '') + symbol\n repl = signPadding + sign + (sepBySpace === 2 ? ' ' : '') + valueAndCS\n break\n case 2:\n valueAndCS = csPrecedes\n ? symbol + (sepBySpace === 1 ? ' ' : '') + value\n : value + (sepBySpace === 1 ? ' ' : '') + symbol\n repl = valueAndCS + (sepBySpace === 2 ? ' ' : '') + sign + signPadding\n break\n case 3:\n repl = csPrecedes\n ? signPadding + sign + (sepBySpace === 2 ? ' ' : '') + symbol +\n (sepBySpace === 1 ? ' ' : '') + value\n : value + (sepBySpace === 1 ? ' ' : '') + sign + signPadding +\n (sepBySpace === 2 ? ' ' : '') + symbol\n break\n case 4:\n repl = csPrecedes\n ? symbol + (sepBySpace === 2 ? ' ' : '') + signPadding + sign +\n (sepBySpace === 1 ? ' ' : '') + value\n : value + (sepBySpace === 1 ? ' ' : '') + symbol +\n (sepBySpace === 2 ? ' ' : '') + sign + signPadding\n break\n }\n }\n\n var padding = width - repl.length\n if (padding > 0) {\n padding = new Array(padding + 1).join(' ')\n // @todo: How does p_sep_by_space affect the count if there is a space?\n // Included in count presumably?\n if (flags.indexOf('-') !== -1) {\n // left-justified (pad to right)\n repl += padding\n } else {\n // right-justified (pad to left)\n repl = padding + repl\n }\n }\n return repl\n }\n\n return format.replace(regex, doReplace)\n}\n"]}
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/nl2br.js b/node_modules/locutus/php/strings/nl2br.js new file mode 100644 index 0000000..d740445 --- /dev/null +++ b/node_modules/locutus/php/strings/nl2br.js @@ -0,0 +1,34 @@ +'use strict'; + +module.exports = function nl2br(str, isXhtml) { + // discuss at: http://locutus.io/php/nl2br/ + // original by: Kevin van Zonneveld (http://kvz.io) + // improved by: Philip Peterson + // improved by: Onno Marsman (https://twitter.com/onnomarsman) + // improved by: Atli Þór + // improved by: Brett Zamir (http://brett-zamir.me) + // improved by: Maximusya + // bugfixed by: Onno Marsman (https://twitter.com/onnomarsman) + // bugfixed by: Kevin van Zonneveld (http://kvz.io) + // bugfixed by: Reynier de la Rosa (http://scriptinside.blogspot.com.es/) + // input by: Brett Zamir (http://brett-zamir.me) + // example 1: nl2br('Kevin\nvan\nZonneveld') + // returns 1: 'Kevin<br />\nvan<br />\nZonneveld' + // example 2: nl2br("\nOne\nTwo\n\nThree\n", false) + // returns 2: '<br>\nOne<br>\nTwo<br>\n<br>\nThree<br>\n' + // example 3: nl2br("\nOne\nTwo\n\nThree\n", true) + // returns 3: '<br />\nOne<br />\nTwo<br />\n<br />\nThree<br />\n' + // example 4: nl2br(null) + // returns 4: '' + + // Some latest browsers when str is null return and unexpected null value + if (typeof str === 'undefined' || str === null) { + return ''; + } + + // Adjust comment to avoid issue on locutus.io display + var breakTag = isXhtml || typeof isXhtml === 'undefined' ? '<br ' + '/>' : '<br>'; + + return (str + '').replace(/(\r\n|\n\r|\r|\n)/g, breakTag + '$1'); +}; +//# sourceMappingURL=nl2br.js.map
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/nl2br.js.map b/node_modules/locutus/php/strings/nl2br.js.map new file mode 100644 index 0000000..fb5e3d2 --- /dev/null +++ b/node_modules/locutus/php/strings/nl2br.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/php/strings/nl2br.js"],"names":["module","exports","nl2br","str","isXhtml","breakTag","replace"],"mappings":";;AAAAA,OAAOC,OAAP,GAAiB,SAASC,KAAT,CAAgBC,GAAhB,EAAqBC,OAArB,EAA8B;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,MAAI,OAAOD,GAAP,KAAe,WAAf,IAA8BA,QAAQ,IAA1C,EAAgD;AAC9C,WAAO,EAAP;AACD;;AAED;AACA,MAAIE,WAAYD,WAAW,OAAOA,OAAP,KAAmB,WAA/B,GAA8C,SAAS,IAAvD,GAA8D,MAA7E;;AAEA,SAAO,CAACD,MAAM,EAAP,EACJG,OADI,CACI,oBADJ,EAC0BD,WAAW,IADrC,CAAP;AAED,CA/BD","file":"nl2br.js","sourcesContent":["module.exports = function nl2br (str, isXhtml) {\n // discuss at: http://locutus.io/php/nl2br/\n // original by: Kevin van Zonneveld (http://kvz.io)\n // improved by: Philip Peterson\n // improved by: Onno Marsman (https://twitter.com/onnomarsman)\n // improved by: Atli Þór\n // improved by: Brett Zamir (http://brett-zamir.me)\n // improved by: Maximusya\n // bugfixed by: Onno Marsman (https://twitter.com/onnomarsman)\n // bugfixed by: Kevin van Zonneveld (http://kvz.io)\n // bugfixed by: Reynier de la Rosa (http://scriptinside.blogspot.com.es/)\n // input by: Brett Zamir (http://brett-zamir.me)\n // example 1: nl2br('Kevin\\nvan\\nZonneveld')\n // returns 1: 'Kevin<br />\\nvan<br />\\nZonneveld'\n // example 2: nl2br(\"\\nOne\\nTwo\\n\\nThree\\n\", false)\n // returns 2: '<br>\\nOne<br>\\nTwo<br>\\n<br>\\nThree<br>\\n'\n // example 3: nl2br(\"\\nOne\\nTwo\\n\\nThree\\n\", true)\n // returns 3: '<br />\\nOne<br />\\nTwo<br />\\n<br />\\nThree<br />\\n'\n // example 4: nl2br(null)\n // returns 4: ''\n\n // Some latest browsers when str is null return and unexpected null value\n if (typeof str === 'undefined' || str === null) {\n return ''\n }\n\n // Adjust comment to avoid issue on locutus.io display\n var breakTag = (isXhtml || typeof isXhtml === 'undefined') ? '<br ' + '/>' : '<br>'\n\n return (str + '')\n .replace(/(\\r\\n|\\n\\r|\\r|\\n)/g, breakTag + '$1')\n}\n"]}
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/nl_langinfo.js b/node_modules/locutus/php/strings/nl_langinfo.js new file mode 100644 index 0000000..5acb293 --- /dev/null +++ b/node_modules/locutus/php/strings/nl_langinfo.js @@ -0,0 +1,108 @@ +'use strict'; + +module.exports = function nl_langinfo(item) { + // eslint-disable-line camelcase + // discuss at: http://locutus.io/php/nl_langinfo/ + // original by: Brett Zamir (http://brett-zamir.me) + // example 1: nl_langinfo('DAY_1') + // returns 1: 'Sunday' + + var setlocale = require('../strings/setlocale'); + + setlocale('LC_ALL', 0); // Ensure locale data is available + + var $global = typeof window !== 'undefined' ? window : global; + $global.$locutus = $global.$locutus || {}; + var $locutus = $global.$locutus; + $locutus.php = $locutus.php || {}; + + var loc = $locutus.php.locales[$locutus.php.localeCategories.LC_TIME]; + if (item.indexOf('ABDAY_') === 0) { + return loc.LC_TIME.a[parseInt(item.replace(/^ABDAY_/, ''), 10) - 1]; + } else if (item.indexOf('DAY_') === 0) { + return loc.LC_TIME.A[parseInt(item.replace(/^DAY_/, ''), 10) - 1]; + } else if (item.indexOf('ABMON_') === 0) { + return loc.LC_TIME.b[parseInt(item.replace(/^ABMON_/, ''), 10) - 1]; + } else if (item.indexOf('MON_') === 0) { + return loc.LC_TIME.B[parseInt(item.replace(/^MON_/, ''), 10) - 1]; + } else { + switch (item) { + // More LC_TIME + case 'AM_STR': + return loc.LC_TIME.p[0]; + case 'PM_STR': + return loc.LC_TIME.p[1]; + case 'D_T_FMT': + return loc.LC_TIME.c; + case 'D_FMT': + return loc.LC_TIME.x; + case 'T_FMT': + return loc.LC_TIME.X; + case 'T_FMT_AMPM': + return loc.LC_TIME.r; + case 'ERA': + case 'ERA_YEAR': + case 'ERA_D_T_FMT': + case 'ERA_D_FMT': + case 'ERA_T_FMT': + // all fall-throughs + return loc.LC_TIME[item]; + } + loc = $locutus.php.locales[$locutus.php.localeCategories.LC_MONETARY]; + if (item === 'CRNCYSTR') { + // alias + item = 'CURRENCY_SYMBOL'; + } + switch (item) { + case 'INT_CURR_SYMBOL': + case 'CURRENCY_SYMBOL': + case 'MON_DECIMAL_POINT': + case 'MON_THOUSANDS_SEP': + case 'POSITIVE_SIGN': + case 'NEGATIVE_SIGN': + case 'INT_FRAC_DIGITS': + case 'FRAC_DIGITS': + case 'P_CS_PRECEDES': + case 'P_SEP_BY_SPACE': + case 'N_CS_PRECEDES': + case 'N_SEP_BY_SPACE': + case 'P_SIGN_POSN': + case 'N_SIGN_POSN': + // all fall-throughs + return loc.LC_MONETARY[item.toLowerCase()]; + case 'MON_GROUPING': + // Same as above, or return something different since this returns an array? + return loc.LC_MONETARY[item.toLowerCase()]; + } + loc = $locutus.php.locales[$locutus.php.localeCategories.LC_NUMERIC]; + switch (item) { + case 'RADIXCHAR': + case 'DECIMAL_POINT': + // Fall-through + return loc.LC_NUMERIC[item.toLowerCase()]; + case 'THOUSEP': + case 'THOUSANDS_SEP': + // Fall-through + return loc.LC_NUMERIC[item.toLowerCase()]; + case 'GROUPING': + // Same as above, or return something different since this returns an array? + return loc.LC_NUMERIC[item.toLowerCase()]; + } + loc = $locutus.php.locales[$locutus.php.localeCategories.LC_MESSAGES]; + switch (item) { + case 'YESEXPR': + case 'NOEXPR': + case 'YESSTR': + case 'NOSTR': + // all fall-throughs + return loc.LC_MESSAGES[item]; + } + loc = $locutus.php.locales[$locutus.php.localeCategories.LC_CTYPE]; + if (item === 'CODESET') { + return loc.LC_CTYPE[item]; + } + + return false; + } +}; +//# sourceMappingURL=nl_langinfo.js.map
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/nl_langinfo.js.map b/node_modules/locutus/php/strings/nl_langinfo.js.map new file mode 100644 index 0000000..0bdeabe --- /dev/null +++ b/node_modules/locutus/php/strings/nl_langinfo.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/php/strings/nl_langinfo.js"],"names":["module","exports","nl_langinfo","item","setlocale","require","$global","window","global","$locutus","php","loc","locales","localeCategories","LC_TIME","indexOf","a","parseInt","replace","A","b","B","p","c","x","X","r","LC_MONETARY","toLowerCase","LC_NUMERIC","LC_MESSAGES","LC_CTYPE"],"mappings":";;AAAAA,OAAOC,OAAP,GAAiB,SAASC,WAAT,CAAsBC,IAAtB,EAA4B;AAAE;AAC7C;AACA;AACA;AACA;;AAEA,MAAIC,YAAYC,QAAQ,sBAAR,CAAhB;;AAEAD,YAAU,QAAV,EAAoB,CAApB,EAR2C,CAQpB;;AAEvB,MAAIE,UAAW,OAAOC,MAAP,KAAkB,WAAlB,GAAgCA,MAAh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P;AACF,WAAK,SAAL;AACA,WAAK,eAAL;AACE;AACA,eAAOjB,IAAIkB,UAAJ,CAAe1B,KAAKyB,WAAL,EAAf,CAAP;AACF,WAAK,UAAL;AACE;AACA,eAAOjB,IAAIkB,UAAJ,CAAe1B,KAAKyB,WAAL,EAAf,CAAP;AAXJ;AAaAjB,UAAMF,SAASC,GAAT,CAAaE,OAAb,CAAqBH,SAASC,GAAT,CAAaG,gBAAb,CAA8BiB,WAAnD,CAAN;AACA,YAAQ3B,IAAR;AACE,WAAK,SAAL;AACA,WAAK,QAAL;AACA,WAAK,QAAL;AACA,WAAK,OAAL;AACE;AACA,eAAOQ,IAAImB,WAAJ,CAAgB3B,IAAhB,CAAP;AANJ;AAQAQ,UAAMF,SAASC,GAAT,CAAaE,OAAb,CAAqBH,SAASC,GAAT,CAAaG,gBAAb,CAA8BkB,QAAnD,CAAN;AACA,QAAI5B,SAAS,SAAb,EAAwB;AACtB,aAAOQ,IAAIoB,QAAJ,CAAa5B,IAAb,CAAP;AACD;;AAED,WAAO,KAAP;AACD;AACF,CAvGD","file":"nl_langinfo.js","sourcesContent":["module.exports = function nl_langinfo (item) { // eslint-disable-line camelcase\n // discuss at: http://locutus.io/php/nl_langinfo/\n // original by: Brett Zamir (http://brett-zamir.me)\n // example 1: nl_langinfo('DAY_1')\n // returns 1: 'Sunday'\n\n var setlocale = require('../strings/setlocale')\n\n setlocale('LC_ALL', 0) // Ensure locale data is available\n\n var $global = (typeof window !== 'undefined' ? window : global)\n $global.$locutus = $global.$locutus || {}\n var $locutus = $global.$locutus\n $locutus.php = $locutus.php || {}\n\n var loc = $locutus.php.locales[$locutus.php.localeCategories.LC_TIME]\n if (item.indexOf('ABDAY_') === 0) {\n return loc.LC_TIME.a[parseInt(item.replace(/^ABDAY_/, ''), 10) - 1]\n } else if (item.indexOf('DAY_') === 0) {\n return loc.LC_TIME.A[parseInt(item.replace(/^DAY_/, ''), 10) - 1]\n } else if (item.indexOf('ABMON_') === 0) {\n return loc.LC_TIME.b[parseInt(item.replace(/^ABMON_/, ''), 10) - 1]\n } else if (item.indexOf('MON_') === 0) {\n return loc.LC_TIME.B[parseInt(item.replace(/^MON_/, ''), 10) - 1]\n } else {\n switch (item) {\n // More LC_TIME\n case 'AM_STR':\n return loc.LC_TIME.p[0]\n case 'PM_STR':\n return loc.LC_TIME.p[1]\n case 'D_T_FMT':\n return loc.LC_TIME.c\n case 'D_FMT':\n return loc.LC_TIME.x\n case 'T_FMT':\n return loc.LC_TIME.X\n case 'T_FMT_AMPM':\n return loc.LC_TIME.r\n case 'ERA':\n case 'ERA_YEAR':\n case 'ERA_D_T_FMT':\n case 'ERA_D_FMT':\n case 'ERA_T_FMT':\n // all fall-throughs\n return loc.LC_TIME[item]\n }\n loc = $locutus.php.locales[$locutus.php.localeCategories.LC_MONETARY]\n if (item === 'CRNCYSTR') {\n // alias\n item = 'CURRENCY_SYMBOL'\n }\n switch (item) {\n case 'INT_CURR_SYMBOL':\n case 'CURRENCY_SYMBOL':\n case 'MON_DECIMAL_POINT':\n case 'MON_THOUSANDS_SEP':\n case 'POSITIVE_SIGN':\n case 'NEGATIVE_SIGN':\n case 'INT_FRAC_DIGITS':\n case 'FRAC_DIGITS':\n case 'P_CS_PRECEDES':\n case 'P_SEP_BY_SPACE':\n case 'N_CS_PRECEDES':\n case 'N_SEP_BY_SPACE':\n case 'P_SIGN_POSN':\n case 'N_SIGN_POSN':\n // all fall-throughs\n return loc.LC_MONETARY[item.toLowerCase()]\n case 'MON_GROUPING':\n // Same as above, or return something different since this returns an array?\n return loc.LC_MONETARY[item.toLowerCase()]\n }\n loc = $locutus.php.locales[$locutus.php.localeCategories.LC_NUMERIC]\n switch (item) {\n case 'RADIXCHAR':\n case 'DECIMAL_POINT':\n // Fall-through\n return loc.LC_NUMERIC[item.toLowerCase()]\n case 'THOUSEP':\n case 'THOUSANDS_SEP':\n // Fall-through\n return loc.LC_NUMERIC[item.toLowerCase()]\n case 'GROUPING':\n // Same as above, or return something different since this returns an array?\n return loc.LC_NUMERIC[item.toLowerCase()]\n }\n loc = $locutus.php.locales[$locutus.php.localeCategories.LC_MESSAGES]\n switch (item) {\n case 'YESEXPR':\n case 'NOEXPR':\n case 'YESSTR':\n case 'NOSTR':\n // all fall-throughs\n return loc.LC_MESSAGES[item]\n }\n loc = $locutus.php.locales[$locutus.php.localeCategories.LC_CTYPE]\n if (item === 'CODESET') {\n return loc.LC_CTYPE[item]\n }\n\n return false\n }\n}\n"]}
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/number_format.js b/node_modules/locutus/php/strings/number_format.js new file mode 100644 index 0000000..2cf6538 --- /dev/null +++ b/node_modules/locutus/php/strings/number_format.js @@ -0,0 +1,79 @@ +'use strict'; + +module.exports = function number_format(number, decimals, decPoint, thousandsSep) { + // eslint-disable-line camelcase + // discuss at: http://locutus.io/php/number_format/ + // original by: Jonas Raoni Soares Silva (http://www.jsfromhell.com) + // improved by: Kevin van Zonneveld (http://kvz.io) + // improved by: davook + // improved by: Brett Zamir (http://brett-zamir.me) + // improved by: Brett Zamir (http://brett-zamir.me) + // improved by: Theriault (https://github.com/Theriault) + // improved by: Kevin van Zonneveld (http://kvz.io) + // bugfixed by: Michael White (http://getsprink.com) + // bugfixed by: Benjamin Lupton + // bugfixed by: Allan Jensen (http://www.winternet.no) + // bugfixed by: Howard Yeend + // bugfixed by: Diogo Resende + // bugfixed by: Rival + // bugfixed by: Brett Zamir (http://brett-zamir.me) + // revised by: Jonas Raoni Soares Silva (http://www.jsfromhell.com) + // revised by: Luke Smith (http://lucassmith.name) + // input by: Kheang Hok Chin (http://www.distantia.ca/) + // input by: Jay Klehr + // input by: Amir Habibi (http://www.residence-mixte.com/) + // input by: Amirouche + // example 1: number_format(1234.56) + // returns 1: '1,235' + // example 2: number_format(1234.56, 2, ',', ' ') + // returns 2: '1 234,56' + // example 3: number_format(1234.5678, 2, '.', '') + // returns 3: '1234.57' + // example 4: number_format(67, 2, ',', '.') + // returns 4: '67,00' + // example 5: number_format(1000) + // returns 5: '1,000' + // example 6: number_format(67.311, 2) + // returns 6: '67.31' + // example 7: number_format(1000.55, 1) + // returns 7: '1,000.6' + // example 8: number_format(67000, 5, ',', '.') + // returns 8: '67.000,00000' + // example 9: number_format(0.9, 0) + // returns 9: '1' + // example 10: number_format('1.20', 2) + // returns 10: '1.20' + // example 11: number_format('1.20', 4) + // returns 11: '1.2000' + // example 12: number_format('1.2000', 3) + // returns 12: '1.200' + // example 13: number_format('1 000,50', 2, '.', ' ') + // returns 13: '100 050.00' + // example 14: number_format(1e-8, 8, '.', '') + // returns 14: '0.00000001' + + number = (number + '').replace(/[^0-9+\-Ee.]/g, ''); + var n = !isFinite(+number) ? 0 : +number; + var prec = !isFinite(+decimals) ? 0 : Math.abs(decimals); + var sep = typeof thousandsSep === 'undefined' ? ',' : thousandsSep; + var dec = typeof decPoint === 'undefined' ? '.' : decPoint; + var s = ''; + + var toFixedFix = function toFixedFix(n, prec) { + var k = Math.pow(10, prec); + return '' + (Math.round(n * k) / k).toFixed(prec); + }; + + // @todo: for IE parseFloat(0.55).toFixed(0) = 0; + s = (prec ? toFixedFix(n, prec) : '' + Math.round(n)).split('.'); + if (s[0].length > 3) { + s[0] = s[0].replace(/\B(?=(?:\d{3})+(?!\d))/g, sep); + } + if ((s[1] || '').length < prec) { + s[1] = s[1] || ''; + s[1] += new Array(prec - s[1].length + 1).join('0'); + } + + return s.join(dec); +}; +//# sourceMappingURL=number_format.js.map
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/number_format.js.map b/node_modules/locutus/php/strings/number_format.js.map new file mode 100644 index 0000000..e220ea8 --- /dev/null +++ b/node_modules/locutus/php/strings/number_format.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/php/strings/number_format.js"],"names":["module","exports","number_format","number","decimals","decPoint","thousandsSep","replace","n","isFinite","prec","Math","abs","sep","dec","s","toFixedFix","k","pow","round","toFixed","split","length","Array","join"],"mappings":";;AAAAA,OAAOC,OAAP,GAAiB,SAASC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AAOA,EAAE,CAAF,EAAKR,OAAL,CAAa,yBAAb,EAAwCM,GAAxC,CAAP;AACD;AACD,MAAI,CAACE,EAAE,CAAF,KAAQ,EAAT,EAAaO,MAAb,GAAsBZ,IAA1B,EAAgC;AAC9BK,MAAE,CAAF,IAAOA,EAAE,CAAF,KAAQ,EAAf;AACAA,MAAE,CAAF,KAAQ,IAAIQ,KAAJ,CAAUb,OAAOK,EAAE,CAAF,EAAKO,MAAZ,GAAqB,CAA/B,EAAkCE,IAAlC,CAAuC,GAAvC,CAAR;AACD;;AAED,SAAOT,EAAES,IAAF,CAAOV,GAAP,CAAP;AACD,CA3ED","file":"number_format.js","sourcesContent":["module.exports = function number_format (number, decimals, decPoint, thousandsSep) { // eslint-disable-line camelcase\n // discuss at: http://locutus.io/php/number_format/\n // original by: Jonas Raoni Soares Silva (http://www.jsfromhell.com)\n // improved by: Kevin van Zonneveld (http://kvz.io)\n // improved by: davook\n // improved by: Brett Zamir (http://brett-zamir.me)\n // improved by: Brett Zamir (http://brett-zamir.me)\n // improved by: Theriault (https://github.com/Theriault)\n // improved by: Kevin van Zonneveld (http://kvz.io)\n // bugfixed by: Michael White (http://getsprink.com)\n // bugfixed by: Benjamin Lupton\n // bugfixed by: Allan Jensen (http://www.winternet.no)\n // bugfixed by: Howard Yeend\n // bugfixed by: Diogo Resende\n // bugfixed by: Rival\n // bugfixed by: Brett Zamir (http://brett-zamir.me)\n // revised by: Jonas Raoni Soares Silva (http://www.jsfromhell.com)\n // revised by: Luke Smith (http://lucassmith.name)\n // input by: Kheang Hok Chin (http://www.distantia.ca/)\n // input by: Jay Klehr\n // input by: Amir Habibi (http://www.residence-mixte.com/)\n // input by: Amirouche\n // example 1: number_format(1234.56)\n // returns 1: '1,235'\n // example 2: number_format(1234.56, 2, ',', ' ')\n // returns 2: '1 234,56'\n // example 3: number_format(1234.5678, 2, '.', '')\n // returns 3: '1234.57'\n // example 4: number_format(67, 2, ',', '.')\n // returns 4: '67,00'\n // example 5: number_format(1000)\n // returns 5: '1,000'\n // example 6: number_format(67.311, 2)\n // returns 6: '67.31'\n // example 7: number_format(1000.55, 1)\n // returns 7: '1,000.6'\n // example 8: number_format(67000, 5, ',', '.')\n // returns 8: '67.000,00000'\n // example 9: number_format(0.9, 0)\n // returns 9: '1'\n // example 10: number_format('1.20', 2)\n // returns 10: '1.20'\n // example 11: number_format('1.20', 4)\n // returns 11: '1.2000'\n // example 12: number_format('1.2000', 3)\n // returns 12: '1.200'\n // example 13: number_format('1 000,50', 2, '.', ' ')\n // returns 13: '100 050.00'\n // example 14: number_format(1e-8, 8, '.', '')\n // returns 14: '0.00000001'\n\n number = (number + '').replace(/[^0-9+\\-Ee.]/g, '')\n var n = !isFinite(+number) ? 0 : +number\n var prec = !isFinite(+decimals) ? 0 : Math.abs(decimals)\n var sep = (typeof thousandsSep === 'undefined') ? ',' : thousandsSep\n var dec = (typeof decPoint === 'undefined') ? '.' : decPoint\n var s = ''\n\n var toFixedFix = function (n, prec) {\n var k = Math.pow(10, prec)\n return '' + (Math.round(n * k) / k)\n .toFixed(prec)\n }\n\n // @todo: for IE parseFloat(0.55).toFixed(0) = 0;\n s = (prec ? toFixedFix(n, prec) : '' + Math.round(n)).split('.')\n if (s[0].length > 3) {\n s[0] = s[0].replace(/\\B(?=(?:\\d{3})+(?!\\d))/g, sep)\n }\n if ((s[1] || '').length < prec) {\n s[1] = s[1] || ''\n s[1] += new Array(prec - s[1].length + 1).join('0')\n }\n\n return s.join(dec)\n}\n"]}
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/ord.js b/node_modules/locutus/php/strings/ord.js new file mode 100644 index 0000000..a23cc36 --- /dev/null +++ b/node_modules/locutus/php/strings/ord.js @@ -0,0 +1,42 @@ +'use strict'; + +module.exports = function ord(string) { + // discuss at: http://locutus.io/php/ord/ + // original by: Kevin van Zonneveld (http://kvz.io) + // bugfixed by: Onno Marsman (https://twitter.com/onnomarsman) + // improved by: Brett Zamir (http://brett-zamir.me) + // input by: incidence + // example 1: ord('K') + // returns 1: 75 + // example 2: ord('\uD800\uDC00'); // surrogate pair to create a single Unicode character + // returns 2: 65536 + + var str = string + ''; + var code = str.charCodeAt(0); + + if (code >= 0xD800 && code <= 0xDBFF) { + // High surrogate (could change last hex to 0xDB7F to treat + // high private surrogates as single characters) + var hi = code; + if (str.length === 1) { + // This is just a high surrogate with no following low surrogate, + // so we return its value; + return code; + // we could also throw an error as it is not a complete character, + // but someone may want to know + } + var low = str.charCodeAt(1); + return (hi - 0xD800) * 0x400 + (low - 0xDC00) + 0x10000; + } + if (code >= 0xDC00 && code <= 0xDFFF) { + // Low surrogate + // This is just a low surrogate with no preceding high surrogate, + // so we return its value; + return code; + // we could also throw an error as it is not a complete character, + // but someone may want to know + } + + return code; +}; +//# sourceMappingURL=ord.js.map
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/ord.js.map b/node_modules/locutus/php/strings/ord.js.map new file mode 100644 index 0000000..6d21ed7 --- /dev/null +++ b/node_modules/locutus/php/strings/ord.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/php/strings/ord.js"],"names":["module","exports","ord","string","str","code","charCodeAt","hi","length","low"],"mappings":";;AAAAA,OAAOC,OAAP,GAAiB,SAASC,GAAT,CAAcC,MAAd,EAAsB;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,MAAIC,MAAMD,SAAS,EAAnB;AACA,MAAIE,OAAOD,IAAIE,UAAJ,CAAe,CAAf,CAAX;;AAEA,MAAID,QAAQ,MAAR,IAAkBA,QAAQ,MAA9B,EAAsC;AACpC;AACA;AACA,QAAIE,KAAKF,IAAT;AACA,QAAID,IAAII,MAAJ,KAAe,CAAnB,EAAsB;AACpB;AACA;AACA,aAAOH,IAAP;AACA;AACA;AACD;AACD,QAAII,MAAML,IAAIE,UAAJ,CAAe,CAAf,CAAV;AACA,WAAQ,CAACC,KAAK,MAAN,IAAgB,KAAjB,IAA2BE,MAAM,MAAjC,IAA2C,OAAlD;AACD;AACD,MAAIJ,QAAQ,MAAR,IAAkBA,QAAQ,MAA9B,EAAsC;AACpC;AACA;AACA;AACA,WAAOA,IAAP;AACA;AACA;AACD;;AAED,SAAOA,IAAP;AACD,CAtCD","file":"ord.js","sourcesContent":["module.exports = function ord (string) {\n // discuss at: http://locutus.io/php/ord/\n // original by: Kevin van Zonneveld (http://kvz.io)\n // bugfixed by: Onno Marsman (https://twitter.com/onnomarsman)\n // improved by: Brett Zamir (http://brett-zamir.me)\n // input by: incidence\n // example 1: ord('K')\n // returns 1: 75\n // example 2: ord('\\uD800\\uDC00'); // surrogate pair to create a single Unicode character\n // returns 2: 65536\n\n var str = string + ''\n var code = str.charCodeAt(0)\n\n if (code >= 0xD800 && code <= 0xDBFF) {\n // High surrogate (could change last hex to 0xDB7F to treat\n // high private surrogates as single characters)\n var hi = code\n if (str.length === 1) {\n // This is just a high surrogate with no following low surrogate,\n // so we return its value;\n return code\n // we could also throw an error as it is not a complete character,\n // but someone may want to know\n }\n var low = str.charCodeAt(1)\n return ((hi - 0xD800) * 0x400) + (low - 0xDC00) + 0x10000\n }\n if (code >= 0xDC00 && code <= 0xDFFF) {\n // Low surrogate\n // This is just a low surrogate with no preceding high surrogate,\n // so we return its value;\n return code\n // we could also throw an error as it is not a complete character,\n // but someone may want to know\n }\n\n return code\n}\n"]}
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/parse_str.js b/node_modules/locutus/php/strings/parse_str.js new file mode 100644 index 0000000..2ab8cb2 --- /dev/null +++ b/node_modules/locutus/php/strings/parse_str.js @@ -0,0 +1,160 @@ +'use strict'; + +module.exports = function parse_str(str, array) { + // eslint-disable-line camelcase + // discuss at: http://locutus.io/php/parse_str/ + // original by: Cagri Ekin + // improved by: Michael White (http://getsprink.com) + // improved by: Jack + // improved by: Brett Zamir (http://brett-zamir.me) + // bugfixed by: Onno Marsman (https://twitter.com/onnomarsman) + // bugfixed by: Brett Zamir (http://brett-zamir.me) + // bugfixed by: stag019 + // bugfixed by: Brett Zamir (http://brett-zamir.me) + // bugfixed by: MIO_KODUKI (http://mio-koduki.blogspot.com/) + // reimplemented by: stag019 + // input by: Dreamer + // input by: Zaide (http://zaidesthings.com/) + // input by: David Pesta (http://davidpesta.com/) + // input by: jeicquest + // bugfixed by: Rafał Kukawski + // note 1: When no argument is specified, will put variables in global scope. + // note 1: When a particular argument has been passed, and the + // note 1: returned value is different parse_str of PHP. + // note 1: For example, a=b=c&d====c + // example 1: var $arr = {} + // example 1: parse_str('first=foo&second=bar', $arr) + // example 1: var $result = $arr + // returns 1: { first: 'foo', second: 'bar' } + // example 2: var $arr = {} + // example 2: parse_str('str_a=Jack+and+Jill+didn%27t+see+the+well.', $arr) + // example 2: var $result = $arr + // returns 2: { str_a: "Jack and Jill didn't see the well." } + // example 3: var $abc = {3:'a'} + // example 3: parse_str('a[b]["c"]=def&a[q]=t+5', $abc) + // example 3: var $result = $abc + // returns 3: {"3":"a","a":{"b":{"c":"def"},"q":"t 5"}} + // example 4: var $arr = {} + // example 4: parse_str('a[][]=value', $arr) + // example 4: var $result = $arr + // returns 4: {"a":{"0":{"0":"value"}}} + // example 5: var $arr = {} + // example 5: parse_str('a=1&a[]=2', $arr) + // example 5: var $result = $arr + // returns 5: {"a":{"0":"2"}} + + var strArr = String(str).replace(/^&/, '').replace(/&$/, '').split('&'); + var sal = strArr.length; + var i; + var j; + var ct; + var p; + var lastObj; + var obj; + var chr; + var tmp; + var key; + var value; + var postLeftBracketPos; + var keys; + var keysLen; + + var _fixStr = function _fixStr(str) { + return decodeURIComponent(str.replace(/\+/g, '%20')); + }; + + var $global = typeof window !== 'undefined' ? window : global; + $global.$locutus = $global.$locutus || {}; + var $locutus = $global.$locutus; + $locutus.php = $locutus.php || {}; + + if (!array) { + array = $global; + } + + for (i = 0; i < sal; i++) { + tmp = strArr[i].split('='); + key = _fixStr(tmp[0]); + value = tmp.length < 2 ? '' : _fixStr(tmp[1]); + + while (key.charAt(0) === ' ') { + key = key.slice(1); + } + + if (key.indexOf('\x00') > -1) { + key = key.slice(0, key.indexOf('\x00')); + } + + if (key && key.charAt(0) !== '[') { + keys = []; + postLeftBracketPos = 0; + + for (j = 0; j < key.length; j++) { + if (key.charAt(j) === '[' && !postLeftBracketPos) { + postLeftBracketPos = j + 1; + } else if (key.charAt(j) === ']') { + if (postLeftBracketPos) { + if (!keys.length) { + keys.push(key.slice(0, postLeftBracketPos - 1)); + } + + keys.push(key.substr(postLeftBracketPos, j - postLeftBracketPos)); + postLeftBracketPos = 0; + + if (key.charAt(j + 1) !== '[') { + break; + } + } + } + } + + if (!keys.length) { + keys = [key]; + } + + for (j = 0; j < keys[0].length; j++) { + chr = keys[0].charAt(j); + + if (chr === ' ' || chr === '.' || chr === '[') { + keys[0] = keys[0].substr(0, j) + '_' + keys[0].substr(j + 1); + } + + if (chr === '[') { + break; + } + } + + obj = array; + + for (j = 0, keysLen = keys.length; j < keysLen; j++) { + key = keys[j].replace(/^['"]/, '').replace(/['"]$/, ''); + lastObj = obj; + + if ((key === '' || key === ' ') && j !== 0) { + // Insert new dimension + ct = -1; + + for (p in obj) { + if (obj.hasOwnProperty(p)) { + if (+p > ct && p.match(/^\d+$/g)) { + ct = +p; + } + } + } + + key = ct + 1; + } + + // if primitive value, replace with object + if (Object(obj[key]) !== obj[key]) { + obj[key] = {}; + } + + obj = obj[key]; + } + + lastObj[key] = value; + } + } +}; +//# sourceMappingURL=parse_str.js.map
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/parse_str.js.map b/node_modules/locutus/php/strings/parse_str.js.map new file mode 100644 index 0000000..f5d4e78 --- /dev/null +++ b/node_modules/locutus/php/strings/parse_str.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/php/strings/parse_str.js"],"names":["module","exports","parse_str","str","array","strArr","String","replace","split","sal","length","i","j","ct","p","lastObj","obj","chr","tmp","key","value","postLeftBracketPos","keys","keysLen","_fixStr","decodeURIComponent","$global","window","global","$locutus","php","charAt","slice","indexOf","push","substr","hasOwnProperty","match","Object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ACjCH,cAAIG,GAAJ,IAAW,EAAX;AACD;;AAEDH,cAAMA,IAAIG,GAAJ,CAAN;AACD;;AAEDJ,cAAQI,GAAR,IAAeC,KAAf;AACD;AACF;AACF,CA3JD","file":"parse_str.js","sourcesContent":["module.exports = function parse_str (str, array) { // eslint-disable-line camelcase\n // discuss at: http://locutus.io/php/parse_str/\n // original by: Cagri Ekin\n // improved by: Michael White (http://getsprink.com)\n // improved by: Jack\n // improved by: Brett Zamir (http://brett-zamir.me)\n // bugfixed by: Onno Marsman (https://twitter.com/onnomarsman)\n // bugfixed by: Brett Zamir (http://brett-zamir.me)\n // bugfixed by: stag019\n // bugfixed by: Brett Zamir (http://brett-zamir.me)\n // bugfixed by: MIO_KODUKI (http://mio-koduki.blogspot.com/)\n // reimplemented by: stag019\n // input by: Dreamer\n // input by: Zaide (http://zaidesthings.com/)\n // input by: David Pesta (http://davidpesta.com/)\n // input by: jeicquest\n // bugfixed by: Rafał Kukawski\n // note 1: When no argument is specified, will put variables in global scope.\n // note 1: When a particular argument has been passed, and the\n // note 1: returned value is different parse_str of PHP.\n // note 1: For example, a=b=c&d====c\n // example 1: var $arr = {}\n // example 1: parse_str('first=foo&second=bar', $arr)\n // example 1: var $result = $arr\n // returns 1: { first: 'foo', second: 'bar' }\n // example 2: var $arr = {}\n // example 2: parse_str('str_a=Jack+and+Jill+didn%27t+see+the+well.', $arr)\n // example 2: var $result = $arr\n // returns 2: { str_a: \"Jack and Jill didn't see the well.\" }\n // example 3: var $abc = {3:'a'}\n // example 3: parse_str('a[b][\"c\"]=def&a[q]=t+5', $abc)\n // example 3: var $result = $abc\n // returns 3: {\"3\":\"a\",\"a\":{\"b\":{\"c\":\"def\"},\"q\":\"t 5\"}}\n // example 4: var $arr = {}\n // example 4: parse_str('a[][]=value', $arr)\n // example 4: var $result = $arr\n // returns 4: {\"a\":{\"0\":{\"0\":\"value\"}}}\n // example 5: var $arr = {}\n // example 5: parse_str('a=1&a[]=2', $arr)\n // example 5: var $result = $arr\n // returns 5: {\"a\":{\"0\":\"2\"}}\n\n var strArr = String(str).replace(/^&/, '').replace(/&$/, '').split('&')\n var sal = strArr.length\n var i\n var j\n var ct\n var p\n var lastObj\n var obj\n var chr\n var tmp\n var key\n var value\n var postLeftBracketPos\n var keys\n var keysLen\n\n var _fixStr = function (str) {\n return decodeURIComponent(str.replace(/\\+/g, '%20'))\n }\n\n var $global = (typeof window !== 'undefined' ? window : global)\n $global.$locutus = $global.$locutus || {}\n var $locutus = $global.$locutus\n $locutus.php = $locutus.php || {}\n\n if (!array) {\n array = $global\n }\n\n for (i = 0; i < sal; i++) {\n tmp = strArr[i].split('=')\n key = _fixStr(tmp[0])\n value = (tmp.length < 2) ? '' : _fixStr(tmp[1])\n\n while (key.charAt(0) === ' ') {\n key = key.slice(1)\n }\n\n if (key.indexOf('\\x00') > -1) {\n key = key.slice(0, key.indexOf('\\x00'))\n }\n\n if (key && key.charAt(0) !== '[') {\n keys = []\n postLeftBracketPos = 0\n\n for (j = 0; j < key.length; j++) {\n if (key.charAt(j) === '[' && !postLeftBracketPos) {\n postLeftBracketPos = j + 1\n } else if (key.charAt(j) === ']') {\n if (postLeftBracketPos) {\n if (!keys.length) {\n keys.push(key.slice(0, postLeftBracketPos - 1))\n }\n\n keys.push(key.substr(postLeftBracketPos, j - postLeftBracketPos))\n postLeftBracketPos = 0\n\n if (key.charAt(j + 1) !== '[') {\n break\n }\n }\n }\n }\n\n if (!keys.length) {\n keys = [key]\n }\n\n for (j = 0; j < keys[0].length; j++) {\n chr = keys[0].charAt(j)\n\n if (chr === ' ' || chr === '.' || chr === '[') {\n keys[0] = keys[0].substr(0, j) + '_' + keys[0].substr(j + 1)\n }\n\n if (chr === '[') {\n break\n }\n }\n\n obj = array\n\n for (j = 0, keysLen = keys.length; j < keysLen; j++) {\n key = keys[j].replace(/^['\"]/, '').replace(/['\"]$/, '')\n lastObj = obj\n\n if ((key === '' || key === ' ') && j !== 0) {\n // Insert new dimension\n ct = -1\n\n for (p in obj) {\n if (obj.hasOwnProperty(p)) {\n if (+p > ct && p.match(/^\\d+$/g)) {\n ct = +p\n }\n }\n }\n\n key = ct + 1\n }\n\n // if primitive value, replace with object\n if (Object(obj[key]) !== obj[key]) {\n obj[key] = {}\n }\n\n obj = obj[key]\n }\n\n lastObj[key] = value\n }\n }\n}\n"]}
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/printf.js b/node_modules/locutus/php/strings/printf.js new file mode 100644 index 0000000..2cc1f95 --- /dev/null +++ b/node_modules/locutus/php/strings/printf.js @@ -0,0 +1,17 @@ +'use strict'; + +module.exports = function printf() { + // discuss at: http://locutus.io/php/printf/ + // original by: Ash Searle (http://hexmen.com/blog/) + // improved by: Michael White (http://getsprink.com) + // improved by: Brett Zamir (http://brett-zamir.me) + // example 1: printf("%01.2f", 123.1) + // returns 1: 6 + + var sprintf = require('../strings/sprintf'); + var echo = require('../strings/echo'); + var ret = sprintf.apply(this, arguments); + echo(ret); + return ret.length; +}; +//# sourceMappingURL=printf.js.map
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/printf.js.map b/node_modules/locutus/php/strings/printf.js.map new file mode 100644 index 0000000..b0975cc --- /dev/null +++ b/node_modules/locutus/php/strings/printf.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/php/strings/printf.js"],"names":["module","exports","printf","sprintf","require","echo","ret","apply","arguments","length"],"mappings":";;AAAAA,OAAOC,OAAP,GAAiB,SAASC,MAAT,GAAmB;AAClC;AACA;AACA;AACA;AACA;AACA;;AAEA,MAAIC,UAAUC,QAAQ,oBAAR,CAAd;AACA,MAAIC,OAAOD,QAAQ,iBAAR,CAAX;AACA,MAAIE,MAAMH,QAAQI,KAAR,CAAc,IAAd,EAAoBC,SAApB,CAAV;AACAH,OAAKC,GAAL;AACA,SAAOA,IAAIG,MAAX;AACD,CAbD","file":"printf.js","sourcesContent":["module.exports = function printf () {\n // discuss at: http://locutus.io/php/printf/\n // original by: Ash Searle (http://hexmen.com/blog/)\n // improved by: Michael White (http://getsprink.com)\n // improved by: Brett Zamir (http://brett-zamir.me)\n // example 1: printf(\"%01.2f\", 123.1)\n // returns 1: 6\n\n var sprintf = require('../strings/sprintf')\n var echo = require('../strings/echo')\n var ret = sprintf.apply(this, arguments)\n echo(ret)\n return ret.length\n}\n"]}
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/quoted_printable_decode.js b/node_modules/locutus/php/strings/quoted_printable_decode.js new file mode 100644 index 0000000..5ad45dc --- /dev/null +++ b/node_modules/locutus/php/strings/quoted_printable_decode.js @@ -0,0 +1,33 @@ +'use strict'; + +module.exports = function quoted_printable_decode(str) { + // eslint-disable-line camelcase + // discuss at: http://locutus.io/php/quoted_printable_decode/ + // original by: Ole Vrijenhoek + // bugfixed by: Brett Zamir (http://brett-zamir.me) + // bugfixed by: Theriault (https://github.com/Theriault) + // reimplemented by: Theriault (https://github.com/Theriault) + // improved by: Brett Zamir (http://brett-zamir.me) + // example 1: quoted_printable_decode('a=3Db=3Dc') + // returns 1: 'a=b=c' + // example 2: quoted_printable_decode('abc =20\r\n123 =20\r\n') + // returns 2: 'abc \r\n123 \r\n' + // example 3: quoted_printable_decode('012345678901234567890123456789012345678901234567890123456789012345678901234=\r\n56789') + // returns 3: '01234567890123456789012345678901234567890123456789012345678901234567890123456789' + // example 4: quoted_printable_decode("Lorem ipsum dolor sit amet=23, consectetur adipisicing elit") + // returns 4: 'Lorem ipsum dolor sit amet#, consectetur adipisicing elit' + + // Decodes all equal signs followed by two hex digits + var RFC2045Decode1 = /=\r\n/gm; + + // the RFC states against decoding lower case encodings, but following apparent PHP behavior + var RFC2045Decode2IN = /=([0-9A-F]{2})/gim; + // RFC2045Decode2IN = /=([0-9A-F]{2})/gm, + + var RFC2045Decode2OUT = function RFC2045Decode2OUT(sMatch, sHex) { + return String.fromCharCode(parseInt(sHex, 16)); + }; + + return str.replace(RFC2045Decode1, '').replace(RFC2045Decode2IN, RFC2045Decode2OUT); +}; +//# sourceMappingURL=quoted_printable_decode.js.map
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/quoted_printable_decode.js.map b/node_modules/locutus/php/strings/quoted_printable_decode.js.map new file mode 100644 index 0000000..d52de41 --- /dev/null +++ b/node_modules/locutus/php/strings/quoted_printable_decode.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/php/strings/quoted_printable_decode.js"],"names":["module","exports","quoted_printable_decode","str","RFC2045Decode1","RFC2045Decode2IN","RFC2045Decode2OUT","sMatch","sHex","String","fromCharCode","parseInt","replace"],"mappings":";;AAAAA,OAAOC,OAAP,GAAiB,SAASC,uBAAT,CAAkCC,GAAlC,EAAuC;AAAE;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,MAAIC,iBAAiB,SAArB;;AAEA;AACA,MAAIC,mBAAmB,mBAAvB;AACA;;AAEA,MAAIC,oBAAoB,SAApBA,iBAAoB,CAAUC,MAAV,EAAkBC,IAAlB,EAAwB;AAC9C,WAAOC,OAAOC,YAAP,CAAoBC,SAASH,IAAT,EAAe,EAAf,CAApB,CAAP;AACD,GAFD;;AAIA,SAAOL,IAAIS,OAAJ,CAAYR,cAAZ,EAA4B,EAA5B,EACJQ,OADI,CACIP,gBADJ,EACsBC,iBADtB,CAAP;AAED,CA7BD","file":"quoted_printable_decode.js","sourcesContent":["module.exports = function quoted_printable_decode (str) { // eslint-disable-line camelcase\n // discuss at: http://locutus.io/php/quoted_printable_decode/\n // original by: Ole Vrijenhoek\n // bugfixed by: Brett Zamir (http://brett-zamir.me)\n // bugfixed by: Theriault (https://github.com/Theriault)\n // reimplemented by: Theriault (https://github.com/Theriault)\n // improved by: Brett Zamir (http://brett-zamir.me)\n // example 1: quoted_printable_decode('a=3Db=3Dc')\n // returns 1: 'a=b=c'\n // example 2: quoted_printable_decode('abc =20\\r\\n123 =20\\r\\n')\n // returns 2: 'abc \\r\\n123 \\r\\n'\n // example 3: quoted_printable_decode('012345678901234567890123456789012345678901234567890123456789012345678901234=\\r\\n56789')\n // returns 3: '01234567890123456789012345678901234567890123456789012345678901234567890123456789'\n // example 4: quoted_printable_decode(\"Lorem ipsum dolor sit amet=23, consectetur adipisicing elit\")\n // returns 4: 'Lorem ipsum dolor sit amet#, consectetur adipisicing elit'\n\n // Decodes all equal signs followed by two hex digits\n var RFC2045Decode1 = /=\\r\\n/gm\n\n // the RFC states against decoding lower case encodings, but following apparent PHP behavior\n var RFC2045Decode2IN = /=([0-9A-F]{2})/gim\n // RFC2045Decode2IN = /=([0-9A-F]{2})/gm,\n\n var RFC2045Decode2OUT = function (sMatch, sHex) {\n return String.fromCharCode(parseInt(sHex, 16))\n }\n\n return str.replace(RFC2045Decode1, '')\n .replace(RFC2045Decode2IN, RFC2045Decode2OUT)\n}\n"]}
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/quoted_printable_encode.js b/node_modules/locutus/php/strings/quoted_printable_encode.js new file mode 100644 index 0000000..27a39b1 --- /dev/null +++ b/node_modules/locutus/php/strings/quoted_printable_encode.js @@ -0,0 +1,48 @@ +'use strict'; + +module.exports = function quoted_printable_encode(str) { + // eslint-disable-line camelcase + // discuss at: http://locutus.io/php/quoted_printable_encode/ + // original by: Theriault (https://github.com/Theriault) + // improved by: Brett Zamir (http://brett-zamir.me) + // improved by: Theriault (https://github.com/Theriault) + // example 1: quoted_printable_encode('a=b=c') + // returns 1: 'a=3Db=3Dc' + // example 2: quoted_printable_encode('abc \r\n123 \r\n') + // returns 2: 'abc =20\r\n123 =20\r\n' + // example 3: quoted_printable_encode('0123456789012345678901234567890123456789012345678901234567890123456789012345') + // returns 3: '012345678901234567890123456789012345678901234567890123456789012345678901234=\r\n5' + // test: skip-2 + + var hexChars = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F']; + var RFC2045Encode1IN = / \r\n|\r\n|[^!-<>-~ ]/gm; + var RFC2045Encode1OUT = function RFC2045Encode1OUT(sMatch) { + // Encode space before CRLF sequence to prevent spaces from being stripped + // Keep hard line breaks intact; CRLF sequences + if (sMatch.length > 1) { + return sMatch.replace(' ', '=20'); + } + // Encode matching character + var chr = sMatch.charCodeAt(0); + return '=' + hexChars[chr >>> 4 & 15] + hexChars[chr & 15]; + }; + + // Split lines to 75 characters; the reason it's 75 and not 76 is because softline breaks are + // preceeded by an equal sign; which would be the 76th character. However, if the last line/string + // was exactly 76 characters, then a softline would not be needed. PHP currently softbreaks + // anyway; so this function replicates PHP. + + var RFC2045Encode2IN = /.{1,72}(?!\r\n)[^=]{0,3}/g; + var RFC2045Encode2OUT = function RFC2045Encode2OUT(sMatch) { + if (sMatch.substr(sMatch.length - 2) === '\r\n') { + return sMatch; + } + return sMatch + '=\r\n'; + }; + + str = str.replace(RFC2045Encode1IN, RFC2045Encode1OUT).replace(RFC2045Encode2IN, RFC2045Encode2OUT); + + // Strip last softline break + return str.substr(0, str.length - 3); +}; +//# sourceMappingURL=quoted_printable_encode.js.map
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/quoted_printable_encode.js.map b/node_modules/locutus/php/strings/quoted_printable_encode.js.map new file mode 100644 index 0000000..2be312f --- /dev/null +++ b/node_modules/locutus/php/strings/quoted_printable_encode.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/php/strings/quoted_printable_encode.js"],"names":["module","exports","quoted_printable_encode","str","hexChars","RFC2045Encode1IN","RFC2045Encode1OUT","sMatch","length","replace","chr","charCodeAt","RFC2045Encode2IN","RFC2045Encode2OUT","substr"],"mappings":";;AAAAA,OAAOC,OAAP,GAAiB,SAASC,uBAAT,CAAkCC,GAAlC,EAAuC;AAAE;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,MAAIC,WAAW,CAAC,GAAD,EAAM,GAAN,EAAW,GAAX,EAAgB,GAAhB,EAAqB,GAArB,EAA0B,GAA1B,EAA+B,GAA/B,EAAoC,GAApC,EAAyC,GAAzC,EAA8C,GAA9C,EAAmD,GAAnD,EAAwD,GAAxD,EAA6D,GAA7D,EAAkE,GAAlE,EAAuE,GAAvE,EAA4E,GAA5E,CAAf;AACA,MAAIC,mBAAmB,yBAAvB;AACA,MAAIC,oBAAoB,SAApBA,iBAAoB,CAAUC,MAAV,EAAkB;AACxC;AACA;AACA,QAAIA,OAAOC,MAAP,GAAgB,CAApB,EAAuB;AACrB,aAAOD,OAAOE,OAAP,CAAe,GAAf,EAAoB,KAApB,CAAP;AACD;AACD;AACA,QAAIC,MAAMH,OAAOI,UAAP,CAAkB,CAAlB,CAAV;AACA,WAAO,MAAMP,SAAWM,QAAQ,CAAT,GAAc,EAAxB,CAAN,GAAqCN,SAAUM,MAAM,EAAhB,CAA5C;AACD,GATD;;AAWA;AACA;AACA;AACA;;AAEA,MAAIE,mBAAmB,2BAAvB;AACA,MAAIC,oBAAoB,SAApBA,iBAAoB,CAAUN,MAAV,EAAkB;AACxC,QAAIA,OAAOO,MAAP,CAAcP,OAAOC,MAAP,GAAgB,CAA9B,MAAqC,MAAzC,EAAiD;AAC/C,aAAOD,MAAP;AACD;AACD,WAAOA,SAAS,OAAhB;AACD,GALD;;AAOAJ,QAAMA,IACHM,OADG,CACKJ,gBADL,EACuBC,iBADvB,EAEHG,OAFG,CAEKG,gBAFL,EAEuBC,iBAFvB,CAAN;;AAIA;AACA,SAAOV,IAAIW,MAAJ,CAAW,CAAX,EAAcX,IAAIK,MAAJ,GAAa,CAA3B,CAAP;AACD,CA7CD","file":"quoted_printable_encode.js","sourcesContent":["module.exports = function quoted_printable_encode (str) { // eslint-disable-line camelcase\n // discuss at: http://locutus.io/php/quoted_printable_encode/\n // original by: Theriault (https://github.com/Theriault)\n // improved by: Brett Zamir (http://brett-zamir.me)\n // improved by: Theriault (https://github.com/Theriault)\n // example 1: quoted_printable_encode('a=b=c')\n // returns 1: 'a=3Db=3Dc'\n // example 2: quoted_printable_encode('abc \\r\\n123 \\r\\n')\n // returns 2: 'abc =20\\r\\n123 =20\\r\\n'\n // example 3: quoted_printable_encode('0123456789012345678901234567890123456789012345678901234567890123456789012345')\n // returns 3: '012345678901234567890123456789012345678901234567890123456789012345678901234=\\r\\n5'\n // test: skip-2\n\n var hexChars = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F']\n var RFC2045Encode1IN = / \\r\\n|\\r\\n|[^!-<>-~ ]/gm\n var RFC2045Encode1OUT = function (sMatch) {\n // Encode space before CRLF sequence to prevent spaces from being stripped\n // Keep hard line breaks intact; CRLF sequences\n if (sMatch.length > 1) {\n return sMatch.replace(' ', '=20')\n }\n // Encode matching character\n var chr = sMatch.charCodeAt(0)\n return '=' + hexChars[((chr >>> 4) & 15)] + hexChars[(chr & 15)]\n }\n\n // Split lines to 75 characters; the reason it's 75 and not 76 is because softline breaks are\n // preceeded by an equal sign; which would be the 76th character. However, if the last line/string\n // was exactly 76 characters, then a softline would not be needed. PHP currently softbreaks\n // anyway; so this function replicates PHP.\n\n var RFC2045Encode2IN = /.{1,72}(?!\\r\\n)[^=]{0,3}/g\n var RFC2045Encode2OUT = function (sMatch) {\n if (sMatch.substr(sMatch.length - 2) === '\\r\\n') {\n return sMatch\n }\n return sMatch + '=\\r\\n'\n }\n\n str = str\n .replace(RFC2045Encode1IN, RFC2045Encode1OUT)\n .replace(RFC2045Encode2IN, RFC2045Encode2OUT)\n\n // Strip last softline break\n return str.substr(0, str.length - 3)\n}\n"]}
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/quotemeta.js b/node_modules/locutus/php/strings/quotemeta.js new file mode 100644 index 0000000..a1f2190 --- /dev/null +++ b/node_modules/locutus/php/strings/quotemeta.js @@ -0,0 +1,11 @@ +'use strict'; + +module.exports = function quotemeta(str) { + // discuss at: http://locutus.io/php/quotemeta/ + // original by: Paulo Freitas + // example 1: quotemeta(". + * ? ^ ( $ )") + // returns 1: '\\. \\+ \\* \\? \\^ \\( \\$ \\)' + + return (str + '').replace(/([.\\+*?[^\]$()])/g, '\\$1'); +}; +//# sourceMappingURL=quotemeta.js.map
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/quotemeta.js.map b/node_modules/locutus/php/strings/quotemeta.js.map new file mode 100644 index 0000000..8731bbb --- /dev/null +++ b/node_modules/locutus/php/strings/quotemeta.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/php/strings/quotemeta.js"],"names":["module","exports","quotemeta","str","replace"],"mappings":";;AAAAA,OAAOC,OAAP,GAAiB,SAASC,SAAT,CAAoBC,GAApB,EAAyB;AACxC;AACA;AACA;AACA;;AAEA,SAAO,CAACA,MAAM,EAAP,EACJC,OADI,CACI,oBADJ,EAC0B,MAD1B,CAAP;AAED,CARD","file":"quotemeta.js","sourcesContent":["module.exports = function quotemeta (str) {\n // discuss at: http://locutus.io/php/quotemeta/\n // original by: Paulo Freitas\n // example 1: quotemeta(\". + * ? ^ ( $ )\")\n // returns 1: '\\\\. \\\\+ \\\\* \\\\? \\\\^ \\\\( \\\\$ \\\\)'\n\n return (str + '')\n .replace(/([.\\\\+*?[^\\]$()])/g, '\\\\$1')\n}\n"]}
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/rtrim.js b/node_modules/locutus/php/strings/rtrim.js new file mode 100644 index 0000000..d781b5b --- /dev/null +++ b/node_modules/locutus/php/strings/rtrim.js @@ -0,0 +1,20 @@ +'use strict'; + +module.exports = function rtrim(str, charlist) { + // discuss at: http://locutus.io/php/rtrim/ + // original by: Kevin van Zonneveld (http://kvz.io) + // input by: Erkekjetter + // input by: rem + // improved by: Kevin van Zonneveld (http://kvz.io) + // bugfixed by: Onno Marsman (https://twitter.com/onnomarsman) + // bugfixed by: Brett Zamir (http://brett-zamir.me) + // example 1: rtrim(' Kevin van Zonneveld ') + // returns 1: ' Kevin van Zonneveld' + + charlist = !charlist ? ' \\s\xA0' : (charlist + '').replace(/([[\]().?/*{}+$^:])/g, '\\$1'); + + var re = new RegExp('[' + charlist + ']+$', 'g'); + + return (str + '').replace(re, ''); +}; +//# sourceMappingURL=rtrim.js.map
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/rtrim.js.map b/node_modules/locutus/php/strings/rtrim.js.map new file mode 100644 index 0000000..7676ced --- /dev/null +++ b/node_modules/locutus/php/strings/rtrim.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/php/strings/rtrim.js"],"names":["module","exports","rtrim","str","charlist","replace","re","RegExp"],"mappings":";;AAAAA,OAAOC,OAAP,GAAiB,SAASC,KAAT,CAAgBC,GAAhB,EAAqBC,QAArB,EAA+B;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEAA,aAAW,CAACA,QAAD,GAAY,UAAZ,GAA2B,CAACA,WAAW,EAAZ,EACnCC,OADmC,CAC3B,sBAD2B,EACH,MADG,CAAtC;;AAGA,MAAIC,KAAK,IAAIC,MAAJ,CAAW,MAAMH,QAAN,GAAiB,KAA5B,EAAmC,GAAnC,CAAT;;AAEA,SAAO,CAACD,MAAM,EAAP,EAAWE,OAAX,CAAmBC,EAAnB,EAAuB,EAAvB,CAAP;AACD,CAjBD","file":"rtrim.js","sourcesContent":["module.exports = function rtrim (str, charlist) {\n // discuss at: http://locutus.io/php/rtrim/\n // original by: Kevin van Zonneveld (http://kvz.io)\n // input by: Erkekjetter\n // input by: rem\n // improved by: Kevin van Zonneveld (http://kvz.io)\n // bugfixed by: Onno Marsman (https://twitter.com/onnomarsman)\n // bugfixed by: Brett Zamir (http://brett-zamir.me)\n // example 1: rtrim(' Kevin van Zonneveld ')\n // returns 1: ' Kevin van Zonneveld'\n\n charlist = !charlist ? ' \\\\s\\u00A0' : (charlist + '')\n .replace(/([[\\]().?/*{}+$^:])/g, '\\\\$1')\n\n var re = new RegExp('[' + charlist + ']+$', 'g')\n\n return (str + '').replace(re, '')\n}\n"]}
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/setlocale.js b/node_modules/locutus/php/strings/setlocale.js new file mode 100644 index 0000000..8b4155f --- /dev/null +++ b/node_modules/locutus/php/strings/setlocale.js @@ -0,0 +1,335 @@ +'use strict'; + +var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; + +module.exports = function setlocale(category, locale) { + // discuss at: http://locutus.io/php/setlocale/ + // original by: Brett Zamir (http://brett-zamir.me) + // original by: Blues (http://hacks.bluesmoon.info/strftime/strftime.js) + // original by: YUI Library (http://developer.yahoo.com/yui/docs/YAHOO.util.DateLocale.html) + // note 1: Is extensible, but currently only implements locales en, + // note 1: en_US, en_GB, en_AU, fr, and fr_CA for LC_TIME only; C for LC_CTYPE; + // note 1: C and en for LC_MONETARY/LC_NUMERIC; en for LC_COLLATE + // note 1: Uses global: locutus to store locale info + // note 1: Consider using http://demo.icu-project.org/icu-bin/locexp as basis for localization (as in i18n_loc_set_default()) + // note 2: This function tries to establish the locale via the `window` global. + // note 2: This feature will not work in Node and hence is Browser-only + // example 1: setlocale('LC_ALL', 'en_US') + // returns 1: 'en_US' + + var getenv = require('../info/getenv'); + + var categ = ''; + var cats = []; + var i = 0; + + var _copy = function _copy(orig) { + if (orig instanceof RegExp) { + return new RegExp(orig); + } else if (orig instanceof Date) { + return new Date(orig); + } + var newObj = {}; + for (var i in orig) { + if (_typeof(orig[i]) === 'object') { + newObj[i] = _copy(orig[i]); + } else { + newObj[i] = orig[i]; + } + } + return newObj; + }; + + // Function usable by a ngettext implementation (apparently not an accessible part of setlocale(), + // but locale-specific) See http://www.gnu.org/software/gettext/manual/gettext.html#Plural-forms + // though amended with others from https://developer.mozilla.org/En/Localization_and_Plurals (new + // categories noted with "MDC" below, though not sure of whether there is a convention for the + // relative order of these newer groups as far as ngettext) The function name indicates the number + // of plural forms (nplural) Need to look into http://cldr.unicode.org/ (maybe future JavaScript); + // Dojo has some functions (under new BSD), including JSON conversions of LDML XML from CLDR: + // http://bugs.dojotoolkit.org/browser/dojo/trunk/cldr and docs at + // http://api.dojotoolkit.org/jsdoc/HEAD/dojo.cldr + + // var _nplurals1 = function (n) { + // // e.g., Japanese + // return 0 + // } + var _nplurals2a = function _nplurals2a(n) { + // e.g., English + return n !== 1 ? 1 : 0; + }; + var _nplurals2b = function _nplurals2b(n) { + // e.g., French + return n > 1 ? 1 : 0; + }; + + var $global = typeof window !== 'undefined' ? window : global; + $global.$locutus = $global.$locutus || {}; + var $locutus = $global.$locutus; + $locutus.php = $locutus.php || {}; + + // Reconcile Windows vs. *nix locale names? + // Allow different priority orders of languages, esp. if implement gettext as in + // LANGUAGE env. var.? (e.g., show German if French is not available) + if (!$locutus.php.locales || !$locutus.php.locales.fr_CA || !$locutus.php.locales.fr_CA.LC_TIME || !$locutus.php.locales.fr_CA.LC_TIME.x) { + // Can add to the locales + $locutus.php.locales = {}; + + $locutus.php.locales.en = { + 'LC_COLLATE': function LC_COLLATE(str1, str2) { + // @todo: This one taken from strcmp, but need for other locales; we don't use localeCompare + // since its locale is not settable + return str1 === str2 ? 0 : str1 > str2 ? 1 : -1; + }, + 'LC_CTYPE': { + // Need to change any of these for English as opposed to C? + an: /^[A-Za-z\d]+$/g, + al: /^[A-Za-z]+$/g, + ct: /^[\u0000-\u001F\u007F]+$/g, + dg: /^[\d]+$/g, + gr: /^[\u0021-\u007E]+$/g, + lw: /^[a-z]+$/g, + pr: /^[\u0020-\u007E]+$/g, + pu: /^[\u0021-\u002F\u003A-\u0040\u005B-\u0060\u007B-\u007E]+$/g, + sp: /^[\f\n\r\t\v ]+$/g, + up: /^[A-Z]+$/g, + xd: /^[A-Fa-f\d]+$/g, + CODESET: 'UTF-8', + // Used by sql_regcase + lower: 'abcdefghijklmnopqrstuvwxyz', + upper: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' + }, + 'LC_TIME': { + // Comments include nl_langinfo() constant equivalents and any + // changes from Blues' implementation + a: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'], + // ABDAY_ + A: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'], + // DAY_ + b: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], + // ABMON_ + B: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'], + // MON_ + c: '%a %d %b %Y %r %Z', + // D_T_FMT // changed %T to %r per results + p: ['AM', 'PM'], + // AM_STR/PM_STR + P: ['am', 'pm'], + // Not available in nl_langinfo() + r: '%I:%M:%S %p', + // T_FMT_AMPM (Fixed for all locales) + x: '%m/%d/%Y', + // D_FMT // switched order of %m and %d; changed %y to %Y (C uses %y) + X: '%r', + // T_FMT // changed from %T to %r (%T is default for C, not English US) + // Following are from nl_langinfo() or http://www.cptec.inpe.br/sx4/sx4man2/g1ab02e/strftime.4.html + alt_digits: '', + // e.g., ordinal + ERA: '', + ERA_YEAR: '', + ERA_D_T_FMT: '', + ERA_D_FMT: '', + ERA_T_FMT: '' + }, + // Assuming distinction between numeric and monetary is thus: + // See below for C locale + 'LC_MONETARY': { + // based on Windows "english" (English_United States.1252) locale + int_curr_symbol: 'USD', + currency_symbol: '$', + mon_decimal_point: '.', + mon_thousands_sep: ',', + mon_grouping: [3], + // use mon_thousands_sep; "" for no grouping; additional array members + // indicate successive group lengths after first group + // (e.g., if to be 1,23,456, could be [3, 2]) + positive_sign: '', + negative_sign: '-', + int_frac_digits: 2, + // Fractional digits only for money defaults? + frac_digits: 2, + p_cs_precedes: 1, + // positive currency symbol follows value = 0; precedes value = 1 + p_sep_by_space: 0, + // 0: no space between curr. symbol and value; 1: space sep. them unless symb. + // and sign are adjacent then space sep. them from value; 2: space sep. sign + // and value unless symb. and sign are adjacent then space separates + n_cs_precedes: 1, + // see p_cs_precedes + n_sep_by_space: 0, + // see p_sep_by_space + p_sign_posn: 3, + // 0: parentheses surround quantity and curr. symbol; 1: sign precedes them; + // 2: sign follows them; 3: sign immed. precedes curr. symbol; 4: sign immed. + // succeeds curr. symbol + n_sign_posn: 0 // see p_sign_posn + }, + 'LC_NUMERIC': { + // based on Windows "english" (English_United States.1252) locale + decimal_point: '.', + thousands_sep: ',', + grouping: [3] // see mon_grouping, but for non-monetary values (use thousands_sep) + }, + 'LC_MESSAGES': { + YESEXPR: '^[yY].*', + NOEXPR: '^[nN].*', + YESSTR: '', + NOSTR: '' + }, + nplurals: _nplurals2a + }; + $locutus.php.locales.en_US = _copy($locutus.php.locales.en); + $locutus.php.locales.en_US.LC_TIME.c = '%a %d %b %Y %r %Z'; + $locutus.php.locales.en_US.LC_TIME.x = '%D'; + $locutus.php.locales.en_US.LC_TIME.X = '%r'; + // The following are based on *nix settings + $locutus.php.locales.en_US.LC_MONETARY.int_curr_symbol = 'USD '; + $locutus.php.locales.en_US.LC_MONETARY.p_sign_posn = 1; + $locutus.php.locales.en_US.LC_MONETARY.n_sign_posn = 1; + $locutus.php.locales.en_US.LC_MONETARY.mon_grouping = [3, 3]; + $locutus.php.locales.en_US.LC_NUMERIC.thousands_sep = ''; + $locutus.php.locales.en_US.LC_NUMERIC.grouping = []; + + $locutus.php.locales.en_GB = _copy($locutus.php.locales.en); + $locutus.php.locales.en_GB.LC_TIME.r = '%l:%M:%S %P %Z'; + + $locutus.php.locales.en_AU = _copy($locutus.php.locales.en_GB); + // Assume C locale is like English (?) (We need C locale for LC_CTYPE) + $locutus.php.locales.C = _copy($locutus.php.locales.en); + $locutus.php.locales.C.LC_CTYPE.CODESET = 'ANSI_X3.4-1968'; + $locutus.php.locales.C.LC_MONETARY = { + int_curr_symbol: '', + currency_symbol: '', + mon_decimal_point: '', + mon_thousands_sep: '', + mon_grouping: [], + p_cs_precedes: 127, + p_sep_by_space: 127, + n_cs_precedes: 127, + n_sep_by_space: 127, + p_sign_posn: 127, + n_sign_posn: 127, + positive_sign: '', + negative_sign: '', + int_frac_digits: 127, + frac_digits: 127 + }; + $locutus.php.locales.C.LC_NUMERIC = { + decimal_point: '.', + thousands_sep: '', + grouping: [] + }; + // D_T_FMT + $locutus.php.locales.C.LC_TIME.c = '%a %b %e %H:%M:%S %Y'; + // D_FMT + $locutus.php.locales.C.LC_TIME.x = '%m/%d/%y'; + // T_FMT + $locutus.php.locales.C.LC_TIME.X = '%H:%M:%S'; + $locutus.php.locales.C.LC_MESSAGES.YESEXPR = '^[yY]'; + $locutus.php.locales.C.LC_MESSAGES.NOEXPR = '^[nN]'; + + $locutus.php.locales.fr = _copy($locutus.php.locales.en); + $locutus.php.locales.fr.nplurals = _nplurals2b; + $locutus.php.locales.fr.LC_TIME.a = ['dim', 'lun', 'mar', 'mer', 'jeu', 'ven', 'sam']; + $locutus.php.locales.fr.LC_TIME.A = ['dimanche', 'lundi', 'mardi', 'mercredi', 'jeudi', 'vendredi', 'samedi']; + $locutus.php.locales.fr.LC_TIME.b = ['jan', 'f\xE9v', 'mar', 'avr', 'mai', 'jun', 'jui', 'ao\xFB', 'sep', 'oct', 'nov', 'd\xE9c']; + $locutus.php.locales.fr.LC_TIME.B = ['janvier', 'f\xE9vrier', 'mars', 'avril', 'mai', 'juin', 'juillet', 'ao\xFBt', 'septembre', 'octobre', 'novembre', 'd\xE9cembre']; + $locutus.php.locales.fr.LC_TIME.c = '%a %d %b %Y %T %Z'; + $locutus.php.locales.fr.LC_TIME.p = ['', '']; + $locutus.php.locales.fr.LC_TIME.P = ['', '']; + $locutus.php.locales.fr.LC_TIME.x = '%d.%m.%Y'; + $locutus.php.locales.fr.LC_TIME.X = '%T'; + + $locutus.php.locales.fr_CA = _copy($locutus.php.locales.fr); + $locutus.php.locales.fr_CA.LC_TIME.x = '%Y-%m-%d'; + } + if (!$locutus.php.locale) { + $locutus.php.locale = 'en_US'; + // Try to establish the locale via the `window` global + if (typeof window !== 'undefined' && window.document) { + var d = window.document; + var NS_XHTML = 'http://www.w3.org/1999/xhtml'; + var NS_XML = 'http://www.w3.org/XML/1998/namespace'; + if (d.getElementsByTagNameNS && d.getElementsByTagNameNS(NS_XHTML, 'html')[0]) { + if (d.getElementsByTagNameNS(NS_XHTML, 'html')[0].getAttributeNS && d.getElementsByTagNameNS(NS_XHTML, 'html')[0].getAttributeNS(NS_XML, 'lang')) { + $locutus.php.locale = d.getElementsByTagName(NS_XHTML, 'html')[0].getAttributeNS(NS_XML, 'lang'); + } else if (d.getElementsByTagNameNS(NS_XHTML, 'html')[0].lang) { + // XHTML 1.0 only + $locutus.php.locale = d.getElementsByTagNameNS(NS_XHTML, 'html')[0].lang; + } + } else if (d.getElementsByTagName('html')[0] && d.getElementsByTagName('html')[0].lang) { + $locutus.php.locale = d.getElementsByTagName('html')[0].lang; + } + } + } + // PHP-style + $locutus.php.locale = $locutus.php.locale.replace('-', '_'); + // @todo: locale if declared locale hasn't been defined + if (!($locutus.php.locale in $locutus.php.locales)) { + if ($locutus.php.locale.replace(/_[a-zA-Z]+$/, '') in $locutus.php.locales) { + $locutus.php.locale = $locutus.php.locale.replace(/_[a-zA-Z]+$/, ''); + } + } + + if (!$locutus.php.localeCategories) { + $locutus.php.localeCategories = { + 'LC_COLLATE': $locutus.php.locale, + // for string comparison, see strcoll() + 'LC_CTYPE': $locutus.php.locale, + // for character classification and conversion, for example strtoupper() + 'LC_MONETARY': $locutus.php.locale, + // for localeconv() + 'LC_NUMERIC': $locutus.php.locale, + // for decimal separator (See also localeconv()) + 'LC_TIME': $locutus.php.locale, + // for date and time formatting with strftime() + // for system responses (available if PHP was compiled with libintl): + 'LC_MESSAGES': $locutus.php.locale + }; + } + + if (locale === null || locale === '') { + locale = getenv(category) || getenv('LANG'); + } else if (Object.prototype.toString.call(locale) === '[object Array]') { + for (i = 0; i < locale.length; i++) { + if (!(locale[i] in $locutus.php.locales)) { + if (i === locale.length - 1) { + // none found + return false; + } + continue; + } + locale = locale[i]; + break; + } + } + + // Just get the locale + if (locale === '0' || locale === 0) { + if (category === 'LC_ALL') { + for (categ in $locutus.php.localeCategories) { + // Add ".UTF-8" or allow ".@latint", etc. to the end? + cats.push(categ + '=' + $locutus.php.localeCategories[categ]); + } + return cats.join(';'); + } + return $locutus.php.localeCategories[category]; + } + + if (!(locale in $locutus.php.locales)) { + // Locale not found + return false; + } + + // Set and get locale + if (category === 'LC_ALL') { + for (categ in $locutus.php.localeCategories) { + $locutus.php.localeCategories[categ] = locale; + } + } else { + $locutus.php.localeCategories[category] = locale; + } + + return locale; +}; +//# sourceMappingURL=setlocale.js.map
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/setlocale.js.map b/node_modules/locutus/php/strings/setlocale.js.map new file mode 100644 index 0000000..fcb505b --- /dev/null +++ b/node_modules/locutus/php/strings/setlocale.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/php/strings/setlocale.js"],"names":["module","exports","setlocale","category","locale","getenv","require","categ","cats","i","_copy","orig","RegExp","Date","newObj","_nplurals2a","n","_nplurals2b","$global","window","global","$locutus","php","locales","fr_CA","LC_TIME","x","en","str1","str2","an","al","ct","dg","gr","lw","pr","pu","sp","up","xd","CODESET","lower","upper","a","A","b","B","c","p","P","r","X","alt_digits","ERA","ERA_YEAR","ERA_D_T_FMT","ERA_D_FMT","ERA_T_FMT","int_curr_symbol","currency_symbol","mon_decimal_point","mon_thousands_sep","mon_grouping","positive_sign","negative_sign","int_frac_digits","frac_digits","p_cs_precedes","p_sep_by_space","n_cs_precedes","n_sep_by_space","p_sign_posn","n_sign_posn","decimal_point","thousands_sep","grouping","YESEXPR","NOEXPR","YESSTR","NOSTR","nplurals","en_US","LC_MONETARY","LC_NUMERIC","en_GB","en_AU","C","LC_CTYPE","LC_MESSAGES","fr","document","d","NS_XHTML","NS_XML","getElementsByTagNameNS","getAttributeNS","getElementsByTagName","lang","replace","localeCategories","Object","prototype","toString","call","length","push","join"],"mappings":";;;;AAAAA,OAAOC,OAAP,GAAiB,SAASC,SAAT,CAAoBC,QAApB,EAA8BC,MAA9B,EAAsC;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA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UiB,SAASC,GAAT,CAAaC,OAAzB,CAAJ,EAAuC;AACrC;AACA,WAAO,KAAP;AACD;;AAED;AACA,MAAIpB,aAAa,QAAjB,EAA2B;AACzB,SAAKI,KAAL,IAAcc,SAASC,GAAT,CAAa8E,gBAA3B,EAA6C;AAC3C/E,eAASC,GAAT,CAAa8E,gBAAb,CAA8B7F,KAA9B,IAAuCH,MAAvC;AACD;AACF,GAJD,MAIO;AACLiB,aAASC,GAAT,CAAa8E,gBAAb,CAA8BjG,QAA9B,IAA0CC,MAA1C;AACD;;AAED,SAAOA,MAAP;AACD,CA1VD","file":"setlocale.js","sourcesContent":["module.exports = function setlocale (category, locale) {\n // discuss at: http://locutus.io/php/setlocale/\n // original by: Brett Zamir (http://brett-zamir.me)\n // original by: Blues (http://hacks.bluesmoon.info/strftime/strftime.js)\n // original by: YUI Library (http://developer.yahoo.com/yui/docs/YAHOO.util.DateLocale.html)\n // note 1: Is extensible, but currently only implements locales en,\n // note 1: en_US, en_GB, en_AU, fr, and fr_CA for LC_TIME only; C for LC_CTYPE;\n // note 1: C and en for LC_MONETARY/LC_NUMERIC; en for LC_COLLATE\n // note 1: Uses global: locutus to store locale info\n // note 1: Consider using http://demo.icu-project.org/icu-bin/locexp as basis for localization (as in i18n_loc_set_default())\n // note 2: This function tries to establish the locale via the `window` global.\n // note 2: This feature will not work in Node and hence is Browser-only\n // example 1: setlocale('LC_ALL', 'en_US')\n // returns 1: 'en_US'\n\n var getenv = require('../info/getenv')\n\n var categ = ''\n var cats = []\n var i = 0\n\n var _copy = function _copy (orig) {\n if (orig instanceof RegExp) {\n return new RegExp(orig)\n } else if (orig instanceof Date) {\n return new Date(orig)\n }\n var newObj = {}\n for (var i in orig) {\n if (typeof orig[i] === 'object') {\n newObj[i] = _copy(orig[i])\n } else {\n newObj[i] = orig[i]\n }\n }\n return newObj\n }\n\n // Function usable by a ngettext implementation (apparently not an accessible part of setlocale(),\n // but locale-specific) See http://www.gnu.org/software/gettext/manual/gettext.html#Plural-forms\n // though amended with others from https://developer.mozilla.org/En/Localization_and_Plurals (new\n // categories noted with \"MDC\" below, though not sure of whether there is a convention for the\n // relative order of these newer groups as far as ngettext) The function name indicates the number\n // of plural forms (nplural) Need to look into http://cldr.unicode.org/ (maybe future JavaScript);\n // Dojo has some functions (under new BSD), including JSON conversions of LDML XML from CLDR:\n // http://bugs.dojotoolkit.org/browser/dojo/trunk/cldr and docs at\n // http://api.dojotoolkit.org/jsdoc/HEAD/dojo.cldr\n\n // var _nplurals1 = function (n) {\n // // e.g., Japanese\n // return 0\n // }\n var _nplurals2a = function (n) {\n // e.g., English\n return n !== 1 ? 1 : 0\n }\n var _nplurals2b = function (n) {\n // e.g., French\n return n > 1 ? 1 : 0\n }\n\n var $global = (typeof window !== 'undefined' ? window : global)\n $global.$locutus = $global.$locutus || {}\n var $locutus = $global.$locutus\n $locutus.php = $locutus.php || {}\n\n // Reconcile Windows vs. *nix locale names?\n // Allow different priority orders of languages, esp. if implement gettext as in\n // LANGUAGE env. var.? (e.g., show German if French is not available)\n if (!$locutus.php.locales ||\n !$locutus.php.locales.fr_CA ||\n !$locutus.php.locales.fr_CA.LC_TIME ||\n !$locutus.php.locales.fr_CA.LC_TIME.x) {\n // Can add to the locales\n $locutus.php.locales = {}\n\n $locutus.php.locales.en = {\n 'LC_COLLATE': function (str1, str2) {\n // @todo: This one taken from strcmp, but need for other locales; we don't use localeCompare\n // since its locale is not settable\n return (str1 === str2) ? 0 : ((str1 > str2) ? 1 : -1)\n },\n 'LC_CTYPE': {\n // Need to change any of these for English as opposed to C?\n an: /^[A-Za-z\\d]+$/g,\n al: /^[A-Za-z]+$/g,\n ct: /^[\\u0000-\\u001F\\u007F]+$/g,\n dg: /^[\\d]+$/g,\n gr: /^[\\u0021-\\u007E]+$/g,\n lw: /^[a-z]+$/g,\n pr: /^[\\u0020-\\u007E]+$/g,\n pu: /^[\\u0021-\\u002F\\u003A-\\u0040\\u005B-\\u0060\\u007B-\\u007E]+$/g,\n sp: /^[\\f\\n\\r\\t\\v ]+$/g,\n up: /^[A-Z]+$/g,\n xd: /^[A-Fa-f\\d]+$/g,\n CODESET: 'UTF-8',\n // Used by sql_regcase\n lower: 'abcdefghijklmnopqrstuvwxyz',\n upper: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'\n },\n 'LC_TIME': {\n // Comments include nl_langinfo() constant equivalents and any\n // changes from Blues' implementation\n a: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],\n // ABDAY_\n A: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],\n // DAY_\n b: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],\n // ABMON_\n B: ['January', 'February', 'March', 'April', 'May', 'June', 'July',\n 'August', 'September', 'October',\n 'November', 'December'\n ],\n // MON_\n c: '%a %d %b %Y %r %Z',\n // D_T_FMT // changed %T to %r per results\n p: ['AM', 'PM'],\n // AM_STR/PM_STR\n P: ['am', 'pm'],\n // Not available in nl_langinfo()\n r: '%I:%M:%S %p',\n // T_FMT_AMPM (Fixed for all locales)\n x: '%m/%d/%Y',\n // D_FMT // switched order of %m and %d; changed %y to %Y (C uses %y)\n X: '%r',\n // T_FMT // changed from %T to %r (%T is default for C, not English US)\n // Following are from nl_langinfo() or http://www.cptec.inpe.br/sx4/sx4man2/g1ab02e/strftime.4.html\n alt_digits: '',\n // e.g., ordinal\n ERA: '',\n ERA_YEAR: '',\n ERA_D_T_FMT: '',\n ERA_D_FMT: '',\n ERA_T_FMT: ''\n },\n // Assuming distinction between numeric and monetary is thus:\n // See below for C locale\n 'LC_MONETARY': {\n // based on Windows \"english\" (English_United States.1252) locale\n int_curr_symbol: 'USD',\n currency_symbol: '$',\n mon_decimal_point: '.',\n mon_thousands_sep: ',',\n mon_grouping: [3],\n // use mon_thousands_sep; \"\" for no grouping; additional array members\n // indicate successive group lengths after first group\n // (e.g., if to be 1,23,456, could be [3, 2])\n positive_sign: '',\n negative_sign: '-',\n int_frac_digits: 2,\n // Fractional digits only for money defaults?\n frac_digits: 2,\n p_cs_precedes: 1,\n // positive currency symbol follows value = 0; precedes value = 1\n p_sep_by_space: 0,\n // 0: no space between curr. symbol and value; 1: space sep. them unless symb.\n // and sign are adjacent then space sep. them from value; 2: space sep. sign\n // and value unless symb. and sign are adjacent then space separates\n n_cs_precedes: 1,\n // see p_cs_precedes\n n_sep_by_space: 0,\n // see p_sep_by_space\n p_sign_posn: 3,\n // 0: parentheses surround quantity and curr. symbol; 1: sign precedes them;\n // 2: sign follows them; 3: sign immed. precedes curr. symbol; 4: sign immed.\n // succeeds curr. symbol\n n_sign_posn: 0 // see p_sign_posn\n },\n 'LC_NUMERIC': {\n // based on Windows \"english\" (English_United States.1252) locale\n decimal_point: '.',\n thousands_sep: ',',\n grouping: [3] // see mon_grouping, but for non-monetary values (use thousands_sep)\n },\n 'LC_MESSAGES': {\n YESEXPR: '^[yY].*',\n NOEXPR: '^[nN].*',\n YESSTR: '',\n NOSTR: ''\n },\n nplurals: _nplurals2a\n }\n $locutus.php.locales.en_US = _copy($locutus.php.locales.en)\n $locutus.php.locales.en_US.LC_TIME.c = '%a %d %b %Y %r %Z'\n $locutus.php.locales.en_US.LC_TIME.x = '%D'\n $locutus.php.locales.en_US.LC_TIME.X = '%r'\n // The following are based on *nix settings\n $locutus.php.locales.en_US.LC_MONETARY.int_curr_symbol = 'USD '\n $locutus.php.locales.en_US.LC_MONETARY.p_sign_posn = 1\n $locutus.php.locales.en_US.LC_MONETARY.n_sign_posn = 1\n $locutus.php.locales.en_US.LC_MONETARY.mon_grouping = [3, 3]\n $locutus.php.locales.en_US.LC_NUMERIC.thousands_sep = ''\n $locutus.php.locales.en_US.LC_NUMERIC.grouping = []\n\n $locutus.php.locales.en_GB = _copy($locutus.php.locales.en)\n $locutus.php.locales.en_GB.LC_TIME.r = '%l:%M:%S %P %Z'\n\n $locutus.php.locales.en_AU = _copy($locutus.php.locales.en_GB)\n // Assume C locale is like English (?) (We need C locale for LC_CTYPE)\n $locutus.php.locales.C = _copy($locutus.php.locales.en)\n $locutus.php.locales.C.LC_CTYPE.CODESET = 'ANSI_X3.4-1968'\n $locutus.php.locales.C.LC_MONETARY = {\n int_curr_symbol: '',\n currency_symbol: '',\n mon_decimal_point: '',\n mon_thousands_sep: '',\n mon_grouping: [],\n p_cs_precedes: 127,\n p_sep_by_space: 127,\n n_cs_precedes: 127,\n n_sep_by_space: 127,\n p_sign_posn: 127,\n n_sign_posn: 127,\n positive_sign: '',\n negative_sign: '',\n int_frac_digits: 127,\n frac_digits: 127\n }\n $locutus.php.locales.C.LC_NUMERIC = {\n decimal_point: '.',\n thousands_sep: '',\n grouping: []\n }\n // D_T_FMT\n $locutus.php.locales.C.LC_TIME.c = '%a %b %e %H:%M:%S %Y'\n // D_FMT\n $locutus.php.locales.C.LC_TIME.x = '%m/%d/%y'\n // T_FMT\n $locutus.php.locales.C.LC_TIME.X = '%H:%M:%S'\n $locutus.php.locales.C.LC_MESSAGES.YESEXPR = '^[yY]'\n $locutus.php.locales.C.LC_MESSAGES.NOEXPR = '^[nN]'\n\n $locutus.php.locales.fr = _copy($locutus.php.locales.en)\n $locutus.php.locales.fr.nplurals = _nplurals2b\n $locutus.php.locales.fr.LC_TIME.a = ['dim', 'lun', 'mar', 'mer', 'jeu', 'ven', 'sam']\n $locutus.php.locales.fr.LC_TIME.A = ['dimanche', 'lundi', 'mardi', 'mercredi',\n 'jeudi', 'vendredi', 'samedi']\n $locutus.php.locales.fr.LC_TIME.b = ['jan', 'f\\u00E9v', 'mar', 'avr', 'mai',\n 'jun', 'jui', 'ao\\u00FB', 'sep', 'oct',\n 'nov', 'd\\u00E9c'\n ]\n $locutus.php.locales.fr.LC_TIME.B = ['janvier', 'f\\u00E9vrier', 'mars',\n 'avril', 'mai', 'juin', 'juillet', 'ao\\u00FBt',\n 'septembre', 'octobre', 'novembre', 'd\\u00E9cembre'\n ]\n $locutus.php.locales.fr.LC_TIME.c = '%a %d %b %Y %T %Z'\n $locutus.php.locales.fr.LC_TIME.p = ['', '']\n $locutus.php.locales.fr.LC_TIME.P = ['', '']\n $locutus.php.locales.fr.LC_TIME.x = '%d.%m.%Y'\n $locutus.php.locales.fr.LC_TIME.X = '%T'\n\n $locutus.php.locales.fr_CA = _copy($locutus.php.locales.fr)\n $locutus.php.locales.fr_CA.LC_TIME.x = '%Y-%m-%d'\n }\n if (!$locutus.php.locale) {\n $locutus.php.locale = 'en_US'\n // Try to establish the locale via the `window` global\n if (typeof window !== 'undefined' && window.document) {\n var d = window.document\n var NS_XHTML = 'http://www.w3.org/1999/xhtml'\n var NS_XML = 'http://www.w3.org/XML/1998/namespace'\n if (d.getElementsByTagNameNS &&\n d.getElementsByTagNameNS(NS_XHTML, 'html')[0]) {\n if (d.getElementsByTagNameNS(NS_XHTML, 'html')[0].getAttributeNS &&\n d.getElementsByTagNameNS(NS_XHTML, 'html')[0].getAttributeNS(NS_XML, 'lang')) {\n $locutus.php.locale = d.getElementsByTagName(NS_XHTML, 'html')[0]\n .getAttributeNS(NS_XML, 'lang')\n } else if (d.getElementsByTagNameNS(NS_XHTML, 'html')[0].lang) {\n // XHTML 1.0 only\n $locutus.php.locale = d.getElementsByTagNameNS(NS_XHTML, 'html')[0].lang\n }\n } else if (d.getElementsByTagName('html')[0] &&\n d.getElementsByTagName('html')[0].lang) {\n $locutus.php.locale = d.getElementsByTagName('html')[0].lang\n }\n }\n }\n // PHP-style\n $locutus.php.locale = $locutus.php.locale.replace('-', '_')\n // @todo: locale if declared locale hasn't been defined\n if (!($locutus.php.locale in $locutus.php.locales)) {\n if ($locutus.php.locale.replace(/_[a-zA-Z]+$/, '') in $locutus.php.locales) {\n $locutus.php.locale = $locutus.php.locale.replace(/_[a-zA-Z]+$/, '')\n }\n }\n\n if (!$locutus.php.localeCategories) {\n $locutus.php.localeCategories = {\n 'LC_COLLATE': $locutus.php.locale,\n // for string comparison, see strcoll()\n 'LC_CTYPE': $locutus.php.locale,\n // for character classification and conversion, for example strtoupper()\n 'LC_MONETARY': $locutus.php.locale,\n // for localeconv()\n 'LC_NUMERIC': $locutus.php.locale,\n // for decimal separator (See also localeconv())\n 'LC_TIME': $locutus.php.locale,\n // for date and time formatting with strftime()\n // for system responses (available if PHP was compiled with libintl):\n 'LC_MESSAGES': $locutus.php.locale\n }\n }\n\n if (locale === null || locale === '') {\n locale = getenv(category) || getenv('LANG')\n } else if (Object.prototype.toString.call(locale) === '[object Array]') {\n for (i = 0; i < locale.length; i++) {\n if (!(locale[i] in $locutus.php.locales)) {\n if (i === locale.length - 1) {\n // none found\n return false\n }\n continue\n }\n locale = locale[i]\n break\n }\n }\n\n // Just get the locale\n if (locale === '0' || locale === 0) {\n if (category === 'LC_ALL') {\n for (categ in $locutus.php.localeCategories) {\n // Add \".UTF-8\" or allow \".@latint\", etc. to the end?\n cats.push(categ + '=' + $locutus.php.localeCategories[categ])\n }\n return cats.join(';')\n }\n return $locutus.php.localeCategories[category]\n }\n\n if (!(locale in $locutus.php.locales)) {\n // Locale not found\n return false\n }\n\n // Set and get locale\n if (category === 'LC_ALL') {\n for (categ in $locutus.php.localeCategories) {\n $locutus.php.localeCategories[categ] = locale\n }\n } else {\n $locutus.php.localeCategories[category] = locale\n }\n\n return locale\n}\n"]}
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/sha1.js b/node_modules/locutus/php/strings/sha1.js new file mode 100644 index 0000000..596b724 --- /dev/null +++ b/node_modules/locutus/php/strings/sha1.js @@ -0,0 +1,151 @@ +'use strict'; + +module.exports = function sha1(str) { + // discuss at: http://locutus.io/php/sha1/ + // original by: Webtoolkit.info (http://www.webtoolkit.info/) + // improved by: Michael White (http://getsprink.com) + // improved by: Kevin van Zonneveld (http://kvz.io) + // input by: Brett Zamir (http://brett-zamir.me) + // note 1: Keep in mind that in accordance with PHP, the whole string is buffered and then + // note 1: hashed. If available, we'd recommend using Node's native crypto modules directly + // note 1: in a steaming fashion for faster and more efficient hashing + // example 1: sha1('Kevin van Zonneveld') + // returns 1: '54916d2e62f65b3afa6e192e6a601cdbe5cb5897' + + var hash; + try { + var crypto = require('crypto'); + var sha1sum = crypto.createHash('sha1'); + sha1sum.update(str); + hash = sha1sum.digest('hex'); + } catch (e) { + hash = undefined; + } + + if (hash !== undefined) { + return hash; + } + + var _rotLeft = function _rotLeft(n, s) { + var t4 = n << s | n >>> 32 - s; + return t4; + }; + + var _cvtHex = function _cvtHex(val) { + var str = ''; + var i; + var v; + + for (i = 7; i >= 0; i--) { + v = val >>> i * 4 & 0x0f; + str += v.toString(16); + } + return str; + }; + + var blockstart; + var i, j; + var W = new Array(80); + var H0 = 0x67452301; + var H1 = 0xEFCDAB89; + var H2 = 0x98BADCFE; + var H3 = 0x10325476; + var H4 = 0xC3D2E1F0; + var A, B, C, D, E; + var temp; + + // utf8_encode + str = unescape(encodeURIComponent(str)); + var strLen = str.length; + + var wordArray = []; + for (i = 0; i < strLen - 3; i += 4) { + j = str.charCodeAt(i) << 24 | str.charCodeAt(i + 1) << 16 | str.charCodeAt(i + 2) << 8 | str.charCodeAt(i + 3); + wordArray.push(j); + } + + switch (strLen % 4) { + case 0: + i = 0x080000000; + break; + case 1: + i = str.charCodeAt(strLen - 1) << 24 | 0x0800000; + break; + case 2: + i = str.charCodeAt(strLen - 2) << 24 | str.charCodeAt(strLen - 1) << 16 | 0x08000; + break; + case 3: + i = str.charCodeAt(strLen - 3) << 24 | str.charCodeAt(strLen - 2) << 16 | str.charCodeAt(strLen - 1) << 8 | 0x80; + break; + } + + wordArray.push(i); + + while (wordArray.length % 16 !== 14) { + wordArray.push(0); + } + + wordArray.push(strLen >>> 29); + wordArray.push(strLen << 3 & 0x0ffffffff); + + for (blockstart = 0; blockstart < wordArray.length; blockstart += 16) { + for (i = 0; i < 16; i++) { + W[i] = wordArray[blockstart + i]; + } + for (i = 16; i <= 79; i++) { + W[i] = _rotLeft(W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16], 1); + } + + A = H0; + B = H1; + C = H2; + D = H3; + E = H4; + + for (i = 0; i <= 19; i++) { + temp = _rotLeft(A, 5) + (B & C | ~B & D) + E + W[i] + 0x5A827999 & 0x0ffffffff; + E = D; + D = C; + C = _rotLeft(B, 30); + B = A; + A = temp; + } + + for (i = 20; i <= 39; i++) { + temp = _rotLeft(A, 5) + (B ^ C ^ D) + E + W[i] + 0x6ED9EBA1 & 0x0ffffffff; + E = D; + D = C; + C = _rotLeft(B, 30); + B = A; + A = temp; + } + + for (i = 40; i <= 59; i++) { + temp = _rotLeft(A, 5) + (B & C | B & D | C & D) + E + W[i] + 0x8F1BBCDC & 0x0ffffffff; + E = D; + D = C; + C = _rotLeft(B, 30); + B = A; + A = temp; + } + + for (i = 60; i <= 79; i++) { + temp = _rotLeft(A, 5) + (B ^ C ^ D) + E + W[i] + 0xCA62C1D6 & 0x0ffffffff; + E = D; + D = C; + C = _rotLeft(B, 30); + B = A; + A = temp; + } + + H0 = H0 + A & 0x0ffffffff; + H1 = H1 + B & 0x0ffffffff; + H2 = H2 + C & 0x0ffffffff; + H3 = H3 + D & 0x0ffffffff; + H4 = H4 + E & 0x0ffffffff; + } + + temp = _cvtHex(H0) + _cvtHex(H1) + _cvtHex(H2) + _cvtHex(H3) + _cvtHex(H4); + return temp.toLowerCase(); +}; +//# sourceMappingURL=sha1.js.map
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/sha1.js.map b/node_modules/locutus/php/strings/sha1.js.map new file mode 100644 index 0000000..ed3baec --- /dev/null +++ b/node_modules/locutus/php/strings/sha1.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/php/strings/sha1.js"],"names":["module","exports","sha1","str","hash","crypto","require","sha1sum","createHash","update","digest","e","undefined","_rotLeft","n","s","t4","_cvtHex","val","i","v","toString","blockstart","j","W","Array","H0","H1","H2","H3","H4","A","B","C","D","E","temp","unescape","encodeURIComponent","strLen","length","wordArray","charCodeAt","push","toLowerCase"],"mappings":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js","sourcesContent":["module.exports = function sha1 (str) {\n // discuss at: http://locutus.io/php/sha1/\n // original by: Webtoolkit.info (http://www.webtoolkit.info/)\n // improved by: Michael White (http://getsprink.com)\n // improved by: Kevin van Zonneveld (http://kvz.io)\n // input by: Brett Zamir (http://brett-zamir.me)\n // note 1: Keep in mind that in accordance with PHP, the whole string is buffered and then\n // note 1: hashed. If available, we'd recommend using Node's native crypto modules directly\n // note 1: in a steaming fashion for faster and more efficient hashing\n // example 1: sha1('Kevin van Zonneveld')\n // returns 1: '54916d2e62f65b3afa6e192e6a601cdbe5cb5897'\n\n var hash\n try {\n var crypto = require('crypto')\n var sha1sum = crypto.createHash('sha1')\n sha1sum.update(str)\n hash = sha1sum.digest('hex')\n } catch (e) {\n hash = undefined\n }\n\n if (hash !== undefined) {\n return hash\n }\n\n var _rotLeft = function (n, s) {\n var t4 = (n << s) | (n >>> (32 - s))\n return t4\n }\n\n var _cvtHex = function (val) {\n var str = ''\n var i\n var v\n\n for (i = 7; i >= 0; i--) {\n v = (val >>> (i * 4)) & 0x0f\n str += v.toString(16)\n }\n return str\n }\n\n var blockstart\n var i, j\n var W = new Array(80)\n var H0 = 0x67452301\n var H1 = 0xEFCDAB89\n var H2 = 0x98BADCFE\n var H3 = 0x10325476\n var H4 = 0xC3D2E1F0\n var A, B, C, D, E\n var temp\n\n // utf8_encode\n str = unescape(encodeURIComponent(str))\n var strLen = str.length\n\n var wordArray = []\n for (i = 0; i < strLen - 3; i += 4) {\n j = str.charCodeAt(i) << 24 |\n str.charCodeAt(i + 1) << 16 |\n str.charCodeAt(i + 2) << 8 |\n str.charCodeAt(i + 3)\n wordArray.push(j)\n }\n\n switch (strLen % 4) {\n case 0:\n i = 0x080000000\n break\n case 1:\n i = str.charCodeAt(strLen - 1) << 24 | 0x0800000\n break\n case 2:\n i = str.charCodeAt(strLen - 2) << 24 | str.charCodeAt(strLen - 1) << 16 | 0x08000\n break\n case 3:\n i = str.charCodeAt(strLen - 3) << 24 |\n str.charCodeAt(strLen - 2) << 16 |\n str.charCodeAt(strLen - 1) <<\n 8 | 0x80\n break\n }\n\n wordArray.push(i)\n\n while ((wordArray.length % 16) !== 14) {\n wordArray.push(0)\n }\n\n wordArray.push(strLen >>> 29)\n wordArray.push((strLen << 3) & 0x0ffffffff)\n\n for (blockstart = 0; blockstart < wordArray.length; blockstart += 16) {\n for (i = 0; i < 16; i++) {\n W[i] = wordArray[blockstart + i]\n }\n for (i = 16; i <= 79; i++) {\n W[i] = _rotLeft(W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16], 1)\n }\n\n A = H0\n B = H1\n C = H2\n D = H3\n E = H4\n\n for (i = 0; i <= 19; i++) {\n temp = (_rotLeft(A, 5) + ((B & C) | (~B & D)) + E + W[i] + 0x5A827999) & 0x0ffffffff\n E = D\n D = C\n C = _rotLeft(B, 30)\n B = A\n A = temp\n }\n\n for (i = 20; i <= 39; i++) {\n temp = (_rotLeft(A, 5) + (B ^ C ^ D) + E + W[i] + 0x6ED9EBA1) & 0x0ffffffff\n E = D\n D = C\n C = _rotLeft(B, 30)\n B = A\n A = temp\n }\n\n for (i = 40; i <= 59; i++) {\n temp = (_rotLeft(A, 5) + ((B & C) | (B & D) | (C & D)) + E + W[i] + 0x8F1BBCDC) & 0x0ffffffff\n E = D\n D = C\n C = _rotLeft(B, 30)\n B = A\n A = temp\n }\n\n for (i = 60; i <= 79; i++) {\n temp = (_rotLeft(A, 5) + (B ^ C ^ D) + E + W[i] + 0xCA62C1D6) & 0x0ffffffff\n E = D\n D = C\n C = _rotLeft(B, 30)\n B = A\n A = temp\n }\n\n H0 = (H0 + A) & 0x0ffffffff\n H1 = (H1 + B) & 0x0ffffffff\n H2 = (H2 + C) & 0x0ffffffff\n H3 = (H3 + D) & 0x0ffffffff\n H4 = (H4 + E) & 0x0ffffffff\n }\n\n temp = _cvtHex(H0) + _cvtHex(H1) + _cvtHex(H2) + _cvtHex(H3) + _cvtHex(H4)\n return temp.toLowerCase()\n}\n"]}
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/sha1_file.js b/node_modules/locutus/php/strings/sha1_file.js new file mode 100644 index 0000000..4cb1035 --- /dev/null +++ b/node_modules/locutus/php/strings/sha1_file.js @@ -0,0 +1,24 @@ +'use strict'; + +module.exports = function sha1_file(str_filename) { + // eslint-disable-line camelcase + // discuss at: http://locutus.io/php/sha1_file/ + // original by: Kevin van Zonneveld (http://kvz.io) + // note 1: Relies on file_get_contents which does not work in the browser, so Node only. + // note 2: Keep in mind that in accordance with PHP, the whole file is buffered and then + // note 2: hashed. We'd recommend Node's native crypto modules for faster and more + // note 2: efficient hashing + // example 1: sha1_file('test/never-change.txt') + // returns 1: '0ea65a1f4b4d69712affc58240932f3eb8a2af66' + + var fileGetContents = require('../filesystem/file_get_contents'); + var sha1 = require('../strings/sha1'); + var buf = fileGetContents(str_filename); + + if (buf === false) { + return false; + } + + return sha1(buf); +}; +//# sourceMappingURL=sha1_file.js.map
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/sha1_file.js.map b/node_modules/locutus/php/strings/sha1_file.js.map new file mode 100644 index 0000000..cf5bcb8 --- /dev/null +++ b/node_modules/locutus/php/strings/sha1_file.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/php/strings/sha1_file.js"],"names":["module","exports","sha1_file","str_filename","fileGetContents","require","sha1","buf"],"mappings":";;AAAAA,OAAOC,OAAP,GAAiB,SAASC,SAAT,CAAoBC,YAApB,EAAkC;AAAE;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,MAAIC,kBAAkBC,QAAQ,iCAAR,CAAtB;AACA,MAAIC,OAAOD,QAAQ,iBAAR,CAAX;AACA,MAAIE,MAAMH,gBAAgBD,YAAhB,CAAV;;AAEA,MAAII,QAAQ,KAAZ,EAAmB;AACjB,WAAO,KAAP;AACD;;AAED,SAAOD,KAAKC,GAAL,CAAP;AACD,CAnBD","file":"sha1_file.js","sourcesContent":["module.exports = function sha1_file (str_filename) { // eslint-disable-line camelcase\n // discuss at: http://locutus.io/php/sha1_file/\n // original by: Kevin van Zonneveld (http://kvz.io)\n // note 1: Relies on file_get_contents which does not work in the browser, so Node only.\n // note 2: Keep in mind that in accordance with PHP, the whole file is buffered and then\n // note 2: hashed. We'd recommend Node's native crypto modules for faster and more\n // note 2: efficient hashing\n // example 1: sha1_file('test/never-change.txt')\n // returns 1: '0ea65a1f4b4d69712affc58240932f3eb8a2af66'\n\n var fileGetContents = require('../filesystem/file_get_contents')\n var sha1 = require('../strings/sha1')\n var buf = fileGetContents(str_filename)\n\n if (buf === false) {\n return false\n }\n\n return sha1(buf)\n}\n"]}
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/similar_text.js b/node_modules/locutus/php/strings/similar_text.js new file mode 100644 index 0000000..964182b --- /dev/null +++ b/node_modules/locutus/php/strings/similar_text.js @@ -0,0 +1,63 @@ +'use strict'; + +module.exports = function similar_text(first, second, percent) { + // eslint-disable-line camelcase + // discuss at: http://locutus.io/php/similar_text/ + // original by: Rafał Kukawski (http://blog.kukawski.pl) + // bugfixed by: Chris McMacken + // bugfixed by: Jarkko Rantavuori original by findings in stackoverflow (http://stackoverflow.com/questions/14136349/how-does-similar-text-work) + // improved by: Markus Padourek (taken from http://www.kevinhq.com/2012/06/php-similartext-function-in-javascript_16.html) + // example 1: similar_text('Hello World!', 'Hello locutus!') + // returns 1: 8 + // example 2: similar_text('Hello World!', null) + // returns 2: 0 + + if (first === null || second === null || typeof first === 'undefined' || typeof second === 'undefined') { + return 0; + } + + first += ''; + second += ''; + + var pos1 = 0; + var pos2 = 0; + var max = 0; + var firstLength = first.length; + var secondLength = second.length; + var p; + var q; + var l; + var sum; + + for (p = 0; p < firstLength; p++) { + for (q = 0; q < secondLength; q++) { + for (l = 0; p + l < firstLength && q + l < secondLength && first.charAt(p + l) === second.charAt(q + l); l++) {// eslint-disable-line max-len + // @todo: ^-- break up this crazy for loop and put the logic in its body + } + if (l > max) { + max = l; + pos1 = p; + pos2 = q; + } + } + } + + sum = max; + + if (sum) { + if (pos1 && pos2) { + sum += similar_text(first.substr(0, pos1), second.substr(0, pos2)); + } + + if (pos1 + max < firstLength && pos2 + max < secondLength) { + sum += similar_text(first.substr(pos1 + max, firstLength - pos1 - max), second.substr(pos2 + max, secondLength - pos2 - max)); + } + } + + if (!percent) { + return sum; + } + + return sum * 200 / (firstLength + secondLength); +}; +//# sourceMappingURL=similar_text.js.map
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/similar_text.js.map b/node_modules/locutus/php/strings/similar_text.js.map new file mode 100644 index 0000000..056a174 --- /dev/null +++ b/node_modules/locutus/php/strings/similar_text.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/php/strings/similar_text.js"],"names":["module","exports","similar_text","first","second","percent","pos1","pos2","max","firstLength","length","secondLength","p","q","l","sum","charAt","substr"],"mappings":";;AAAAA,OAAOC,OAAP,GAAiB,SAASC,YAAT,CAAuBC,KAAvB,EAA8BC,MAA9B,EAAsCC,OAAtC,EAA+C;AAAE;AAChE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,MAAIF,UAAU,IAAV,IACFC,WAAW,IADT,IAEF,OAAOD,KAAP,KAAiB,WAFf,IAGF,OAAOC,MAAP,KAAkB,WAHpB,EAGiC;AAC/B,WAAO,CAAP;AACD;;AAEDD,WAAS,EAAT;AACAC,YAAU,EAAV;;AAEA,MAAIE,OAAO,CAAX;AACA,MAAIC,OAAO,CAAX;AACA,MAAIC,MAAM,CAAV;AACA,MAAIC,cAAcN,MAAMO,MAAxB;AACA,MAAIC,eAAeP,OAAOM,MAA1B;AACA,MAAIE,CAAJ;AACA,MAAIC,CAAJ;AACA,MAAIC,CAAJ;AACA,MAAIC,GAAJ;;AAEA,OAAKH,IAAI,CAAT,EAAYA,IAAIH,WAAhB,EAA6BG,GAA7B,EAAkC;AAChC,SAAKC,IAAI,CAAT,EAAYA,IAAIF,YAAhB,EAA8BE,GAA9B,EAAmC;AACjC,WAAKC,IAAI,CAAT,EAAaF,IAAIE,CAAJ,GAAQL,WAAT,IAA0BI,IAAIC,CAAJ,GAAQH,YAAlC,IAAoDR,MAAMa,MAAN,CAAaJ,IAAIE,CAAjB,MAAwBV,OAAOY,MAAP,CAAcH,IAAIC,CAAlB,CAAxF,EAA+GA,GAA/G,EAAoH,CAAE;AACpH;AACD;AACD,UAAIA,IAAIN,GAAR,EAAa;AACXA,cAAMM,CAAN;AACAR,eAAOM,CAAP;AACAL,eAAOM,CAAP;AACD;AACF;AACF;;AAEDE,QAAMP,GAAN;;AAEA,MAAIO,GAAJ,EAAS;AACP,QAAIT,QAAQC,IAAZ,EAAkB;AAChBQ,aAAOb,aAAaC,MAAMc,MAAN,CAAa,CAAb,EAAgBX,IAAhB,CAAb,EAAoCF,OAAOa,MAAP,CAAc,CAAd,EAAiBV,IAAjB,CAApC,CAAP;AACD;;AAED,QAAKD,OAAOE,GAAP,GAAaC,WAAd,IAA+BF,OAAOC,GAAP,GAAaG,YAAhD,EAA+D;AAC7DI,aAAOb,aACLC,MAAMc,MAAN,CAAaX,OAAOE,GAApB,EAAyBC,cAAcH,IAAd,GAAqBE,GAA9C,CADK,EAELJ,OAAOa,MAAP,CAAcV,OAAOC,GAArB,EACAG,eAAeJ,IAAf,GAAsBC,GADtB,CAFK,CAAP;AAID;AACF;;AAED,MAAI,CAACH,OAAL,EAAc;AACZ,WAAOU,GAAP;AACD;;AAED,SAAQA,MAAM,GAAP,IAAeN,cAAcE,YAA7B,CAAP;AACD,CAhED","file":"similar_text.js","sourcesContent":["module.exports = function similar_text (first, second, percent) { // eslint-disable-line camelcase\n // discuss at: http://locutus.io/php/similar_text/\n // original by: Rafał Kukawski (http://blog.kukawski.pl)\n // bugfixed by: Chris McMacken\n // bugfixed by: Jarkko Rantavuori original by findings in stackoverflow (http://stackoverflow.com/questions/14136349/how-does-similar-text-work)\n // improved by: Markus Padourek (taken from http://www.kevinhq.com/2012/06/php-similartext-function-in-javascript_16.html)\n // example 1: similar_text('Hello World!', 'Hello locutus!')\n // returns 1: 8\n // example 2: similar_text('Hello World!', null)\n // returns 2: 0\n\n if (first === null ||\n second === null ||\n typeof first === 'undefined' ||\n typeof second === 'undefined') {\n return 0\n }\n\n first += ''\n second += ''\n\n var pos1 = 0\n var pos2 = 0\n var max = 0\n var firstLength = first.length\n var secondLength = second.length\n var p\n var q\n var l\n var sum\n\n for (p = 0; p < firstLength; p++) {\n for (q = 0; q < secondLength; q++) {\n for (l = 0; (p + l < firstLength) && (q + l < secondLength) && (first.charAt(p + l) === second.charAt(q + l)); l++) { // eslint-disable-line max-len\n // @todo: ^-- break up this crazy for loop and put the logic in its body\n }\n if (l > max) {\n max = l\n pos1 = p\n pos2 = q\n }\n }\n }\n\n sum = max\n\n if (sum) {\n if (pos1 && pos2) {\n sum += similar_text(first.substr(0, pos1), second.substr(0, pos2))\n }\n\n if ((pos1 + max < firstLength) && (pos2 + max < secondLength)) {\n sum += similar_text(\n first.substr(pos1 + max, firstLength - pos1 - max),\n second.substr(pos2 + max,\n secondLength - pos2 - max))\n }\n }\n\n if (!percent) {\n return sum\n }\n\n return (sum * 200) / (firstLength + secondLength)\n}\n"]}
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/soundex.js b/node_modules/locutus/php/strings/soundex.js new file mode 100644 index 0000000..e9207c1 --- /dev/null +++ b/node_modules/locutus/php/strings/soundex.js @@ -0,0 +1,67 @@ +'use strict'; + +module.exports = function soundex(str) { + // discuss at: http://locutus.io/php/soundex/ + // original by: Jonas Raoni Soares Silva (http://www.jsfromhell.com) + // original by: Arnout Kazemier (http://www.3rd-Eden.com) + // improved by: Jack + // improved by: Kevin van Zonneveld (http://kvz.io) + // bugfixed by: Onno Marsman (https://twitter.com/onnomarsman) + // bugfixed by: Kevin van Zonneveld (http://kvz.io) + // input by: Brett Zamir (http://brett-zamir.me) + // revised by: Rafał Kukawski (http://blog.kukawski.pl) + // example 1: soundex('Kevin') + // returns 1: 'K150' + // example 2: soundex('Ellery') + // returns 2: 'E460' + // example 3: soundex('Euler') + // returns 3: 'E460' + + str = (str + '').toUpperCase(); + if (!str) { + return ''; + } + + var sdx = [0, 0, 0, 0]; + var m = { + B: 1, + F: 1, + P: 1, + V: 1, + C: 2, + G: 2, + J: 2, + K: 2, + Q: 2, + S: 2, + X: 2, + Z: 2, + D: 3, + T: 3, + L: 4, + M: 5, + N: 5, + R: 6 + }; + var i = 0; + var j; + var s = 0; + var c; + var p; + + while ((c = str.charAt(i++)) && s < 4) { + if (j = m[c]) { + if (j !== p) { + sdx[s++] = p = j; + } + } else { + s += i === 1; + p = 0; + } + } + + sdx[0] = str.charAt(0); + + return sdx.join(''); +}; +//# sourceMappingURL=soundex.js.map
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/soundex.js.map b/node_modules/locutus/php/strings/soundex.js.map new file mode 100644 index 0000000..a63cae7 --- /dev/null +++ b/node_modules/locutus/php/strings/soundex.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/php/strings/soundex.js"],"names":["module","exports","soundex","str","toUpperCase","sdx","m","B","F","P","V","C","G","J","K","Q","S","X","Z","D","T","L","M","N","R","i","j","s","c","p","charAt","join"],"mappings":";;AAAAA,OAAOC,OAAP,GAAiB,SAASC,OAAT,CAAkBC,GAAlB,EAAuB;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEAA,QAAM,CAACA,MAAM,EAAP,EAAWC,WAAX,EAAN;AACA,MAAI,CAACD,GAAL,EAAU;AACR,WAAO,EAAP;AACD;;AAED,MAAIE,MAAM,CAAC,CAAD,EAAI,CAAJ,EAAO,CAAP,EAAU,CAAV,CAAV;AACA,MAAIC,IAAI;AACNC,OAAG,CADG;AAENC,OAAG,CAFG;AAGNC,OAAG,CAHG;AAINC,OAAG,CAJG;AAKNC,OAAG,CALG;AAMNC,OAAG,CANG;AAONC,OAAG,CAPG;AAQNC,OAAG,CARG;AASNC,OAAG,CATG;AAUNC,OAAG,CAVG;AAWNC,OAAG,CAXG;AAYNC,OAAG,CAZG;AAaNC,OAAG,CAbG;AAcNC,OAAG,CAdG;AAeNC,OAAG,CAfG;AAgBNC,OAAG,CAhBG;AAiBNC,OAAG,CAjBG;AAkBNC,OAAG;AAlBG,GAAR;AAoBA,MAAIC,IAAI,CAAR;AACA,MAAIC,CAAJ;AACA,MAAIC,IAAI,CAAR;AACA,MAAIC,CAAJ;AACA,MAAIC,CAAJ;;AAEA,SAAO,CAACD,IAAIzB,IAAI2B,MAAJ,CAAWL,GAAX,CAAL,KAAyBE,IAAI,CAApC,EAAuC;AACrC,QAAKD,IAAIpB,EAAEsB,CAAF,CAAT,EAAgB;AACd,UAAIF,MAAMG,CAAV,EAAa;AACXxB,YAAIsB,GAAJ,IAAWE,IAAIH,CAAf;AACD;AACF,KAJD,MAIO;AACLC,WAAKF,MAAM,CAAX;AACAI,UAAI,CAAJ;AACD;AACF;;AAEDxB,MAAI,CAAJ,IAASF,IAAI2B,MAAJ,CAAW,CAAX,CAAT;;AAEA,SAAOzB,IAAI0B,IAAJ,CAAS,EAAT,CAAP;AACD,CA/DD","file":"soundex.js","sourcesContent":["module.exports = function soundex (str) {\n // discuss at: http://locutus.io/php/soundex/\n // original by: Jonas Raoni Soares Silva (http://www.jsfromhell.com)\n // original by: Arnout Kazemier (http://www.3rd-Eden.com)\n // improved by: Jack\n // improved by: Kevin van Zonneveld (http://kvz.io)\n // bugfixed by: Onno Marsman (https://twitter.com/onnomarsman)\n // bugfixed by: Kevin van Zonneveld (http://kvz.io)\n // input by: Brett Zamir (http://brett-zamir.me)\n // revised by: Rafał Kukawski (http://blog.kukawski.pl)\n // example 1: soundex('Kevin')\n // returns 1: 'K150'\n // example 2: soundex('Ellery')\n // returns 2: 'E460'\n // example 3: soundex('Euler')\n // returns 3: 'E460'\n\n str = (str + '').toUpperCase()\n if (!str) {\n return ''\n }\n\n var sdx = [0, 0, 0, 0]\n var m = {\n B: 1,\n F: 1,\n P: 1,\n V: 1,\n C: 2,\n G: 2,\n J: 2,\n K: 2,\n Q: 2,\n S: 2,\n X: 2,\n Z: 2,\n D: 3,\n T: 3,\n L: 4,\n M: 5,\n N: 5,\n R: 6\n }\n var i = 0\n var j\n var s = 0\n var c\n var p\n\n while ((c = str.charAt(i++)) && s < 4) {\n if ((j = m[c])) {\n if (j !== p) {\n sdx[s++] = p = j\n }\n } else {\n s += i === 1\n p = 0\n }\n }\n\n sdx[0] = str.charAt(0)\n\n return sdx.join('')\n}\n"]}
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/split.js b/node_modules/locutus/php/strings/split.js new file mode 100644 index 0000000..fdd4b33 --- /dev/null +++ b/node_modules/locutus/php/strings/split.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports = function split(delimiter, string) { + // discuss at: http://locutus.io/php/split/ + // original by: Kevin van Zonneveld (http://kvz.io) + // example 1: split(' ', 'Kevin van Zonneveld') + // returns 1: ['Kevin', 'van', 'Zonneveld'] + + var explode = require('../strings/explode'); + return explode(delimiter, string); +}; +//# sourceMappingURL=split.js.map
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/split.js.map b/node_modules/locutus/php/strings/split.js.map new file mode 100644 index 0000000..144db5e --- /dev/null +++ b/node_modules/locutus/php/strings/split.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/php/strings/split.js"],"names":["module","exports","split","delimiter","string","explode","require"],"mappings":";;AAAAA,OAAOC,OAAP,GAAiB,SAASC,KAAT,CAAgBC,SAAhB,EAA2BC,MAA3B,EAAmC;AAClD;AACA;AACA;AACA;;AAEA,MAAIC,UAAUC,QAAQ,oBAAR,CAAd;AACA,SAAOD,QAAQF,SAAR,EAAmBC,MAAnB,CAAP;AACD,CARD","file":"split.js","sourcesContent":["module.exports = function split (delimiter, string) {\n // discuss at: http://locutus.io/php/split/\n // original by: Kevin van Zonneveld (http://kvz.io)\n // example 1: split(' ', 'Kevin van Zonneveld')\n // returns 1: ['Kevin', 'van', 'Zonneveld']\n\n var explode = require('../strings/explode')\n return explode(delimiter, string)\n}\n"]}
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/sprintf.js b/node_modules/locutus/php/strings/sprintf.js new file mode 100644 index 0000000..103b8e3 --- /dev/null +++ b/node_modules/locutus/php/strings/sprintf.js @@ -0,0 +1,193 @@ +'use strict'; + +module.exports = function sprintf() { + // discuss at: http://locutus.io/php/sprintf/ + // original by: Ash Searle (http://hexmen.com/blog/) + // improved by: Michael White (http://getsprink.com) + // improved by: Jack + // improved by: Kevin van Zonneveld (http://kvz.io) + // improved by: Kevin van Zonneveld (http://kvz.io) + // improved by: Kevin van Zonneveld (http://kvz.io) + // improved by: Dj + // improved by: Allidylls + // input by: Paulo Freitas + // input by: Brett Zamir (http://brett-zamir.me) + // improved by: Rafał Kukawski (http://kukawski.pl) + // example 1: sprintf("%01.2f", 123.1) + // returns 1: '123.10' + // example 2: sprintf("[%10s]", 'monkey') + // returns 2: '[ monkey]' + // example 3: sprintf("[%'#10s]", 'monkey') + // returns 3: '[####monkey]' + // example 4: sprintf("%d", 123456789012345) + // returns 4: '123456789012345' + // example 5: sprintf('%-03s', 'E') + // returns 5: 'E00' + // example 6: sprintf('%+010d', 9) + // returns 6: '+000000009' + // example 7: sprintf('%+0\'@10d', 9) + // returns 7: '@@@@@@@@+9' + // example 8: sprintf('%.f', 3.14) + // returns 8: '3.140000' + // example 9: sprintf('%% %2$d', 1, 2) + // returns 9: '% 2' + + var regex = /%%|%(?:(\d+)\$)?((?:[-+#0 ]|'[\s\S])*)(\d+)?(?:\.(\d*))?([\s\S])/g; + var args = arguments; + var i = 0; + var format = args[i++]; + + var _pad = function _pad(str, len, chr, leftJustify) { + if (!chr) { + chr = ' '; + } + var padding = str.length >= len ? '' : new Array(1 + len - str.length >>> 0).join(chr); + return leftJustify ? str + padding : padding + str; + }; + + var justify = function justify(value, prefix, leftJustify, minWidth, padChar) { + var diff = minWidth - value.length; + if (diff > 0) { + // when padding with zeros + // on the left side + // keep sign (+ or -) in front + if (!leftJustify && padChar === '0') { + value = [value.slice(0, prefix.length), _pad('', diff, '0', true), value.slice(prefix.length)].join(''); + } else { + value = _pad(value, minWidth, padChar, leftJustify); + } + } + return value; + }; + + var _formatBaseX = function _formatBaseX(value, base, leftJustify, minWidth, precision, padChar) { + // Note: casts negative numbers to positive ones + var number = value >>> 0; + value = _pad(number.toString(base), precision || 0, '0', false); + return justify(value, '', leftJustify, minWidth, padChar); + }; + + // _formatString() + var _formatString = function _formatString(value, leftJustify, minWidth, precision, customPadChar) { + if (precision !== null && precision !== undefined) { + value = value.slice(0, precision); + } + return justify(value, '', leftJustify, minWidth, customPadChar); + }; + + // doFormat() + var doFormat = function doFormat(substring, argIndex, modifiers, minWidth, precision, specifier) { + var number, prefix, method, textTransform, value; + + if (substring === '%%') { + return '%'; + } + + // parse modifiers + var padChar = ' '; // pad with spaces by default + var leftJustify = false; + var positiveNumberPrefix = ''; + var j, l; + + for (j = 0, l = modifiers.length; j < l; j++) { + switch (modifiers.charAt(j)) { + case ' ': + case '0': + padChar = modifiers.charAt(j); + break; + case '+': + positiveNumberPrefix = '+'; + break; + case '-': + leftJustify = true; + break; + case "'": + if (j + 1 < l) { + padChar = modifiers.charAt(j + 1); + j++; + } + break; + } + } + + if (!minWidth) { + minWidth = 0; + } else { + minWidth = +minWidth; + } + + if (!isFinite(minWidth)) { + throw new Error('Width must be finite'); + } + + if (!precision) { + precision = specifier === 'd' ? 0 : 'fFeE'.indexOf(specifier) > -1 ? 6 : undefined; + } else { + precision = +precision; + } + + if (argIndex && +argIndex === 0) { + throw new Error('Argument number must be greater than zero'); + } + + if (argIndex && +argIndex >= args.length) { + throw new Error('Too few arguments'); + } + + value = argIndex ? args[+argIndex] : args[i++]; + + switch (specifier) { + case '%': + return '%'; + case 's': + return _formatString(value + '', leftJustify, minWidth, precision, padChar); + case 'c': + return _formatString(String.fromCharCode(+value), leftJustify, minWidth, precision, padChar); + case 'b': + return _formatBaseX(value, 2, leftJustify, minWidth, precision, padChar); + case 'o': + return _formatBaseX(value, 8, leftJustify, minWidth, precision, padChar); + case 'x': + return _formatBaseX(value, 16, leftJustify, minWidth, precision, padChar); + case 'X': + return _formatBaseX(value, 16, leftJustify, minWidth, precision, padChar).toUpperCase(); + case 'u': + return _formatBaseX(value, 10, leftJustify, minWidth, precision, padChar); + case 'i': + case 'd': + number = +value || 0; + // Plain Math.round doesn't just truncate + number = Math.round(number - number % 1); + prefix = number < 0 ? '-' : positiveNumberPrefix; + value = prefix + _pad(String(Math.abs(number)), precision, '0', false); + + if (leftJustify && padChar === '0') { + // can't right-pad 0s on integers + padChar = ' '; + } + return justify(value, prefix, leftJustify, minWidth, padChar); + case 'e': + case 'E': + case 'f': // @todo: Should handle locales (as per setlocale) + case 'F': + case 'g': + case 'G': + number = +value; + prefix = number < 0 ? '-' : positiveNumberPrefix; + method = ['toExponential', 'toFixed', 'toPrecision']['efg'.indexOf(specifier.toLowerCase())]; + textTransform = ['toString', 'toUpperCase']['eEfFgG'.indexOf(specifier) % 2]; + value = prefix + Math.abs(number)[method](precision); + return justify(value, prefix, leftJustify, minWidth, padChar)[textTransform](); + default: + // unknown specifier, consume that char and return empty + return ''; + } + }; + + try { + return format.replace(regex, doFormat); + } catch (err) { + return false; + } +}; +//# sourceMappingURL=sprintf.js.map
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/sprintf.js.map b/node_modules/locutus/php/strings/sprintf.js.map new file mode 100644 index 0000000..1a753d8 --- /dev/null +++ b/node_modules/locutus/php/strings/sprintf.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/php/strings/sprintf.js"],"names":["module","exports","sprintf","regex","args","arguments","i","format","_pad","str","len","chr","leftJustify","padding","length","Array","join","justify","value","prefix","minWidth","padChar","diff","slice","_formatBaseX","base","precision","number","toString","_formatString","customPadChar","undefined","doFormat","substring","argIndex","modifiers","specifier","method","textTransform","positiveNumberPrefix","j","l","charAt","isFinite","Error","indexOf","String","fromCharCode","toUpperCase","Math","round","abs","toLowerCase","replace","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AAjB;;AAEA,YAAId,eAAeS,YAAY,GAA/B,EAAoC;AAClC;AACAA,oBAAU,GAAV;AACD;AACD,eAAOJ,QAAQC,KAAR,EAAeC,MAAf,EAAuBP,WAAvB,EAAoCQ,QAApC,EAA8CC,OAA9C,CAAP;AACF,WAAK,GAAL;AACA,WAAK,GAAL;AACA,WAAK,GAAL,CAjCF,CAiCY;AACV,WAAK,GAAL;AACA,WAAK,GAAL;AACA,WAAK,GAAL;AACEM,iBAAS,CAACT,KAAV;AACAC,iBAASQ,SAAS,CAAT,GAAa,GAAb,GAAmBY,oBAA5B;AACAF,iBAAS,CAAC,eAAD,EAAkB,SAAlB,EAA6B,aAA7B,EAA4C,MAAMQ,OAAN,CAAcT,UAAUgB,WAAV,EAAd,CAA5C,CAAT;AACAd,wBAAgB,CAAC,UAAD,EAAa,aAAb,EAA4B,SAASO,OAAT,CAAiBT,SAAjB,IAA8B,CAA1D,CAAhB;AACAlB,gBAAQC,SAAS8B,KAAKE,GAAL,CAASxB,MAAT,EAAiBU,MAAjB,EAAyBX,SAAzB,CAAjB;AACA,eAAOT,QAAQC,KAAR,EAAeC,MAAf,EAAuBP,WAAvB,EAAoCQ,QAApC,EAA8CC,OAA9C,EAAuDiB,aAAvD,GAAP;AACF;AACE;AACA,eAAO,EAAP;AA7CJ;AA+CD,GA3GD;;AA6GA,MAAI;AACF,WAAO/B,OAAO8C,OAAP,CAAelD,KAAf,EAAsB6B,QAAtB,CAAP;AACD,GAFD,CAEE,OAAOsB,GAAP,EAAY;AACZ,WAAO,KAAP;AACD;AACF,CAlMD","file":"sprintf.js","sourcesContent":["module.exports = function sprintf () {\n // discuss at: http://locutus.io/php/sprintf/\n // original by: Ash Searle (http://hexmen.com/blog/)\n // improved by: Michael White (http://getsprink.com)\n // improved by: Jack\n // improved by: Kevin van Zonneveld (http://kvz.io)\n // improved by: Kevin van Zonneveld (http://kvz.io)\n // improved by: Kevin van Zonneveld (http://kvz.io)\n // improved by: Dj\n // improved by: Allidylls\n // input by: Paulo Freitas\n // input by: Brett Zamir (http://brett-zamir.me)\n // improved by: Rafał Kukawski (http://kukawski.pl)\n // example 1: sprintf(\"%01.2f\", 123.1)\n // returns 1: '123.10'\n // example 2: sprintf(\"[%10s]\", 'monkey')\n // returns 2: '[ monkey]'\n // example 3: sprintf(\"[%'#10s]\", 'monkey')\n // returns 3: '[####monkey]'\n // example 4: sprintf(\"%d\", 123456789012345)\n // returns 4: '123456789012345'\n // example 5: sprintf('%-03s', 'E')\n // returns 5: 'E00'\n // example 6: sprintf('%+010d', 9)\n // returns 6: '+000000009'\n // example 7: sprintf('%+0\\'@10d', 9)\n // returns 7: '@@@@@@@@+9'\n // example 8: sprintf('%.f', 3.14)\n // returns 8: '3.140000'\n // example 9: sprintf('%% %2$d', 1, 2)\n // returns 9: '% 2'\n\n var regex = /%%|%(?:(\\d+)\\$)?((?:[-+#0 ]|'[\\s\\S])*)(\\d+)?(?:\\.(\\d*))?([\\s\\S])/g\n var args = arguments\n var i = 0\n var format = args[i++]\n\n var _pad = function (str, len, chr, leftJustify) {\n if (!chr) {\n chr = ' '\n }\n var padding = (str.length >= len) ? '' : new Array(1 + len - str.length >>> 0).join(chr)\n return leftJustify ? str + padding : padding + str\n }\n\n var justify = function (value, prefix, leftJustify, minWidth, padChar) {\n var diff = minWidth - value.length\n if (diff > 0) {\n // when padding with zeros\n // on the left side\n // keep sign (+ or -) in front\n if (!leftJustify && padChar === '0') {\n value = [\n value.slice(0, prefix.length),\n _pad('', diff, '0', true),\n value.slice(prefix.length)\n ].join('')\n } else {\n value = _pad(value, minWidth, padChar, leftJustify)\n }\n }\n return value\n }\n\n var _formatBaseX = function (value, base, leftJustify, minWidth, precision, padChar) {\n // Note: casts negative numbers to positive ones\n var number = value >>> 0\n value = _pad(number.toString(base), precision || 0, '0', false)\n return justify(value, '', leftJustify, minWidth, padChar)\n }\n\n // _formatString()\n var _formatString = function (value, leftJustify, minWidth, precision, customPadChar) {\n if (precision !== null && precision !== undefined) {\n value = value.slice(0, precision)\n }\n return justify(value, '', leftJustify, minWidth, customPadChar)\n }\n\n // doFormat()\n var doFormat = function (substring, argIndex, modifiers, minWidth, precision, specifier) {\n var number, prefix, method, textTransform, value\n\n if (substring === '%%') {\n return '%'\n }\n\n // parse modifiers\n var padChar = ' ' // pad with spaces by default\n var leftJustify = false\n var positiveNumberPrefix = ''\n var j, l\n\n for (j = 0, l = modifiers.length; j < l; j++) {\n switch (modifiers.charAt(j)) {\n case ' ':\n case '0':\n padChar = modifiers.charAt(j)\n break\n case '+':\n positiveNumberPrefix = '+'\n break\n case '-':\n leftJustify = true\n break\n case \"'\":\n if (j + 1 < l) {\n padChar = modifiers.charAt(j + 1)\n j++\n }\n break\n }\n }\n\n if (!minWidth) {\n minWidth = 0\n } else {\n minWidth = +minWidth\n }\n\n if (!isFinite(minWidth)) {\n throw new Error('Width must be finite')\n }\n\n if (!precision) {\n precision = (specifier === 'd') ? 0 : 'fFeE'.indexOf(specifier) > -1 ? 6 : undefined\n } else {\n precision = +precision\n }\n\n if (argIndex && +argIndex === 0) {\n throw new Error('Argument number must be greater than zero')\n }\n\n if (argIndex && +argIndex >= args.length) {\n throw new Error('Too few arguments')\n }\n\n value = argIndex ? args[+argIndex] : args[i++]\n\n switch (specifier) {\n case '%':\n return '%'\n case 's':\n return _formatString(value + '', leftJustify, minWidth, precision, padChar)\n case 'c':\n return _formatString(String.fromCharCode(+value), leftJustify, minWidth, precision, padChar)\n case 'b':\n return _formatBaseX(value, 2, leftJustify, minWidth, precision, padChar)\n case 'o':\n return _formatBaseX(value, 8, leftJustify, minWidth, precision, padChar)\n case 'x':\n return _formatBaseX(value, 16, leftJustify, minWidth, precision, padChar)\n case 'X':\n return _formatBaseX(value, 16, leftJustify, minWidth, precision, padChar)\n .toUpperCase()\n case 'u':\n return _formatBaseX(value, 10, leftJustify, minWidth, precision, padChar)\n case 'i':\n case 'd':\n number = +value || 0\n // Plain Math.round doesn't just truncate\n number = Math.round(number - number % 1)\n prefix = number < 0 ? '-' : positiveNumberPrefix\n value = prefix + _pad(String(Math.abs(number)), precision, '0', false)\n\n if (leftJustify && padChar === '0') {\n // can't right-pad 0s on integers\n padChar = ' '\n }\n return justify(value, prefix, leftJustify, minWidth, padChar)\n case 'e':\n case 'E':\n case 'f': // @todo: Should handle locales (as per setlocale)\n case 'F':\n case 'g':\n case 'G':\n number = +value\n prefix = number < 0 ? '-' : positiveNumberPrefix\n method = ['toExponential', 'toFixed', 'toPrecision']['efg'.indexOf(specifier.toLowerCase())]\n textTransform = ['toString', 'toUpperCase']['eEfFgG'.indexOf(specifier) % 2]\n value = prefix + Math.abs(number)[method](precision)\n return justify(value, prefix, leftJustify, minWidth, padChar)[textTransform]()\n default:\n // unknown specifier, consume that char and return empty\n return ''\n }\n }\n\n try {\n return format.replace(regex, doFormat)\n } catch (err) {\n return false\n }\n}\n"]}
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/sscanf.js b/node_modules/locutus/php/strings/sscanf.js new file mode 100644 index 0000000..32fd585 --- /dev/null +++ b/node_modules/locutus/php/strings/sscanf.js @@ -0,0 +1,268 @@ +'use strict'; + +module.exports = function sscanf(str, format) { + // discuss at: http://locutus.io/php/sscanf/ + // original by: Brett Zamir (http://brett-zamir.me) + // example 1: sscanf('SN/2350001', 'SN/%d') + // returns 1: [2350001] + // example 2: var myVar = {} + // example 2: sscanf('SN/2350001', 'SN/%d', myVar) + // example 2: var $result = myVar.value + // returns 2: 2350001 + // example 3: sscanf("10--20", "%2$d--%1$d") // Must escape '$' in PHP, but not JS + // returns 3: [20, 10] + + var retArr = []; + var _NWS = /\S/; + var args = arguments; + var digit; + + var _setExtraConversionSpecs = function _setExtraConversionSpecs(offset) { + // Since a mismatched character sets us off track from future + // legitimate finds, we just scan + // to the end for any other conversion specifications (besides a percent literal), + // setting them to null + // sscanf seems to disallow all conversion specification components (of sprintf) + // except for type specifiers + // Do not allow % in last char. class + // var matches = format.match(/%[+-]?([ 0]|'.)?-?\d*(\.\d+)?[bcdeufFosxX]/g); + // Do not allow % in last char. class: + var matches = format.slice(offset).match(/%[cdeEufgosxX]/g); + // b, F,G give errors in PHP, but 'g', though also disallowed, doesn't + if (matches) { + var lgth = matches.length; + while (lgth--) { + retArr.push(null); + } + } + return _finish(); + }; + + var _finish = function _finish() { + if (args.length === 2) { + return retArr; + } + for (var i = 0; i < retArr.length; ++i) { + args[i + 2].value = retArr[i]; + } + return i; + }; + + var _addNext = function _addNext(j, regex, cb) { + if (assign) { + var remaining = str.slice(j); + var check = width ? remaining.substr(0, width) : remaining; + var match = regex.exec(check); + // @todo: Make this more readable + var key = digit !== undefined ? digit : retArr.length; + var testNull = retArr[key] = match ? cb ? cb.apply(null, match) : match[0] : null; + if (testNull === null) { + throw new Error('No match in string'); + } + return j + match[0].length; + } + return j; + }; + + if (arguments.length < 2) { + throw new Error('Not enough arguments passed to sscanf'); + } + + // PROCESS + for (var i = 0, j = 0; i < format.length; i++) { + var width = 0; + var assign = true; + + if (format.charAt(i) === '%') { + if (format.charAt(i + 1) === '%') { + if (str.charAt(j) === '%') { + // a matched percent literal + // skip beyond duplicated percent + ++i; + ++j; + continue; + } + // Format indicated a percent literal, but not actually present + return _setExtraConversionSpecs(i + 2); + } + + // CHARACTER FOLLOWING PERCENT IS NOT A PERCENT + + // We need 'g' set to get lastIndex + var prePattern = new RegExp('^(?:(\\d+)\\$)?(\\*)?(\\d*)([hlL]?)', 'g'); + + var preConvs = prePattern.exec(format.slice(i + 1)); + + var tmpDigit = digit; + if (tmpDigit && preConvs[1] === undefined) { + var msg = 'All groups in sscanf() must be expressed as numeric if '; + msg += 'any have already been used'; + throw new Error(msg); + } + digit = preConvs[1] ? parseInt(preConvs[1], 10) - 1 : undefined; + + assign = !preConvs[2]; + width = parseInt(preConvs[3], 10); + var sizeCode = preConvs[4]; + i += prePattern.lastIndex; + + // @todo: Does PHP do anything with these? Seems not to matter + if (sizeCode) { + // This would need to be processed later + switch (sizeCode) { + case 'h': + case 'l': + case 'L': + // Treats subsequent as short int (for d,i,n) or unsigned short int (for o,u,x) + // Treats subsequent as long int (for d,i,n), or unsigned long int (for o,u,x); + // or as double (for e,f,g) instead of float or wchar_t instead of char + // Treats subsequent as long double (for e,f,g) + break; + default: + throw new Error('Unexpected size specifier in sscanf()!'); + } + } + // PROCESS CHARACTER + try { + // For detailed explanations, see http://web.archive.org/web/20031128125047/http://www.uwm.edu/cgi-bin/IMT/wwwman?topic=scanf%283%29&msection= + // Also http://www.mathworks.com/access/helpdesk/help/techdoc/ref/sscanf.html + // p, S, C arguments in C function not available + // DOCUMENTED UNDER SSCANF + switch (format.charAt(i + 1)) { + case 'F': + // Not supported in PHP sscanf; the argument is treated as a float, and + // presented as a floating-point number (non-locale aware) + // sscanf doesn't support locales, so no need for two (see %f) + break; + case 'g': + // Not supported in PHP sscanf; shorter of %e and %f + // Irrelevant to input conversion + break; + case 'G': + // Not supported in PHP sscanf; shorter of %E and %f + // Irrelevant to input conversion + break; + case 'b': + // Not supported in PHP sscanf; the argument is treated as an integer, + // and presented as a binary number + // Not supported - couldn't distinguish from other integers + break; + case 'i': + // Integer with base detection (Equivalent of 'd', but base 0 instead of 10) + var pattern = /([+-])?(?:(?:0x([\da-fA-F]+))|(?:0([0-7]+))|(\d+))/; + j = _addNext(j, pattern, function (num, sign, hex, oct, dec) { + return hex ? parseInt(num, 16) : oct ? parseInt(num, 8) : parseInt(num, 10); + }); + break; + case 'n': + // Number of characters processed so far + retArr[digit !== undefined ? digit : retArr.length - 1] = j; + break; + // DOCUMENTED UNDER SPRINTF + case 'c': + // Get character; suppresses skipping over whitespace! + // (but shouldn't be whitespace in format anyways, so no difference here) + // Non-greedy match + j = _addNext(j, new RegExp('.{1,' + (width || 1) + '}')); + break; + case 'D': + case 'd': + // sscanf documented decimal number; equivalent of 'd'; + // Optionally signed decimal integer + j = _addNext(j, /([+-])?(?:0*)(\d+)/, function (num, sign, dec) { + // Ignores initial zeroes, unlike %i and parseInt() + var decInt = parseInt((sign || '') + dec, 10); + if (decInt < 0) { + // PHP also won't allow less than -2147483648 + // integer overflow with negative + return decInt < -2147483648 ? -2147483648 : decInt; + } else { + // PHP also won't allow greater than -2147483647 + return decInt < 2147483647 ? decInt : 2147483647; + } + }); + break; + case 'f': + case 'E': + case 'e': + // Although sscanf doesn't support locales, + // this is used instead of '%F'; seems to be same as %e + // These don't discriminate here as both allow exponential float of either case + j = _addNext(j, /([+-])?(?:0*)(\d*\.?\d*(?:[eE]?\d+)?)/, function (num, sign, dec) { + if (dec === '.') { + return null; + } + // Ignores initial zeroes, unlike %i and parseFloat() + return parseFloat((sign || '') + dec); + }); + break; + case 'u': + // unsigned decimal integer + // We won't deal with integer overflows due to signs + j = _addNext(j, /([+-])?(?:0*)(\d+)/, function (num, sign, dec) { + // Ignores initial zeroes, unlike %i and parseInt() + var decInt = parseInt(dec, 10); + if (sign === '-') { + // PHP also won't allow greater than 4294967295 + // integer overflow with negative + return 4294967296 - decInt; + } else { + return decInt < 4294967295 ? decInt : 4294967295; + } + }); + break; + case 'o': + // Octal integer // @todo: add overflows as above? + j = _addNext(j, /([+-])?(?:0([0-7]+))/, function (num, sign, oct) { + return parseInt(num, 8); + }); + break; + case 's': + // Greedy match + j = _addNext(j, /\S+/); + break; + case 'X': + case 'x': + // Same as 'x'? + // @todo: add overflows as above? + // Initial 0x not necessary here + j = _addNext(j, /([+-])?(?:(?:0x)?([\da-fA-F]+))/, function (num, sign, hex) { + return parseInt(num, 16); + }); + break; + case '': + // If no character left in expression + throw new Error('Missing character after percent mark in sscanf() format argument'); + default: + throw new Error('Unrecognized character after percent mark in sscanf() format argument'); + } + } catch (e) { + if (e === 'No match in string') { + // Allow us to exit + return _setExtraConversionSpecs(i + 2); + } + // Calculate skipping beyond initial percent too + } + ++i; + } else if (format.charAt(i) !== str.charAt(j)) { + // @todo: Double-check i whitespace ignored in string and/or formats + _NWS.lastIndex = 0; + if (_NWS.test(str.charAt(j)) || str.charAt(j) === '') { + // Whitespace doesn't need to be an exact match) + return _setExtraConversionSpecs(i + 1); + } else { + // Adjust strings when encounter non-matching whitespace, + // so they align in future checks above + // Ok to replace with j++;? + str = str.slice(0, j) + str.slice(j + 1); + i--; + } + } else { + j++; + } + } + + // POST-PROCESSING + return _finish(); +}; +//# sourceMappingURL=sscanf.js.map
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/sscanf.js.map b/node_modules/locutus/php/strings/sscanf.js.map new file mode 100644 index 0000000..1c44a6f --- /dev/null +++ b/node_modules/locutus/php/strings/sscanf.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/php/strings/sscanf.js"],"names":["module","exports","sscanf","str","format","retArr","_NWS","args","arguments","digit","_setExtraConversionSpecs","offset","matches","slice","match","lgth","length","push","_finish","i","value","_addNext","j","regex","cb","assign","remaining","check","width","substr","exec","key","undefined","testNull","apply","Error","charAt","prePattern","RegExp","preConvs","tmpDigit","msg","parseInt","sizeCode","lastIndex","pattern","num","sign","hex","oct","dec","decInt","parseFloat","e","test"],"mappings":";;AAAAA,OAAOC,OAAP,GAAiB,SAASC,MAAT,CAAiBC,GAAjB,EAAsBC,MAAtB,EAA8B;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,MAAIC,SAAS,EAAb;AACA,MAAIC,OAAO,IAAX;AACA,MAAIC,OAAOC,SAAX;AACA,MAAIC,KAAJ;;AAEA,MAAIC,2BAA2B,SAA3BA,wBAA2B,CAAUC,MAAV,EAAkB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAIC,UAAUR,OAAOS,KAAP,CAAaF,MAAb,EAAqBG,KAArB,CAA2B,iBAA3B,CAAd;AACA;AACA,QAAIF,OAAJ,EAAa;AACX,UAAIG,OAAOH,QAAQI,MAAnB;AACA,aAAOD,MAAP,EAAe;AACbV,eAAOY,IAAP,CAAY,IAAZ;AACD;AACF;AACD,WAAOC,SAAP;AACD,GAnBD;;AAqBA,MAAIA,UAAU,SAAVA,OAAU,GAAY;AACxB,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;AAC9B;AACA,iBAAO3C,yBAAyBS,IAAI,CAA7B,CAAP;AACD;AACD;AACD;AACD,QAAEA,CAAF;AACD,KA5KD,MA4KO,IAAIf,OAAOgC,MAAP,CAAcjB,CAAd,MAAqBhB,IAAIiC,MAAJ,CAAWd,CAAX,CAAzB,EAAwC;AAC3C;AACFhB,WAAKsC,SAAL,GAAiB,CAAjB;AACA,UAAKtC,IAAD,CACDgD,IADC,CACInD,IAAIiC,MAAJ,CAAWd,CAAX,CADJ,KACsBnB,IAAIiC,MAAJ,CAAWd,CAAX,MAAkB,EAD5C,EACgD;AAC9C;AACA,eAAOZ,yBAAyBS,IAAI,CAA7B,CAAP;AACD,OAJD,MAIO;AACL;AACA;AACA;AACAhB,cAAMA,IAAIU,KAAJ,CAAU,CAAV,EAAaS,CAAb,IAAkBnB,IAAIU,KAAJ,CAAUS,IAAI,CAAd,CAAxB;AACAH;AACD;AACF,KAdM,MAcA;AACLG;AACD;AACF;;AAED;AACA,SAAOJ,SAAP;AACD,CAhRD","file":"sscanf.js","sourcesContent":["module.exports = function sscanf (str, format) {\n // discuss at: http://locutus.io/php/sscanf/\n // original by: Brett Zamir (http://brett-zamir.me)\n // example 1: sscanf('SN/2350001', 'SN/%d')\n // returns 1: [2350001]\n // example 2: var myVar = {}\n // example 2: sscanf('SN/2350001', 'SN/%d', myVar)\n // example 2: var $result = myVar.value\n // returns 2: 2350001\n // example 3: sscanf(\"10--20\", \"%2$d--%1$d\") // Must escape '$' in PHP, but not JS\n // returns 3: [20, 10]\n\n var retArr = []\n var _NWS = /\\S/\n var args = arguments\n var digit\n\n var _setExtraConversionSpecs = function (offset) {\n // Since a mismatched character sets us off track from future\n // legitimate finds, we just scan\n // to the end for any other conversion specifications (besides a percent literal),\n // setting them to null\n // sscanf seems to disallow all conversion specification components (of sprintf)\n // except for type specifiers\n // Do not allow % in last char. class\n // var matches = format.match(/%[+-]?([ 0]|'.)?-?\\d*(\\.\\d+)?[bcdeufFosxX]/g);\n // Do not allow % in last char. class:\n var matches = format.slice(offset).match(/%[cdeEufgosxX]/g)\n // b, F,G give errors in PHP, but 'g', though also disallowed, doesn't\n if (matches) {\n var lgth = matches.length\n while (lgth--) {\n retArr.push(null)\n }\n }\n return _finish()\n }\n\n var _finish = function () {\n if (args.length === 2) {\n return retArr\n }\n for (var i = 0; i < retArr.length; ++i) {\n args[i + 2].value = retArr[i]\n }\n return i\n }\n\n var _addNext = function (j, regex, cb) {\n if (assign) {\n var remaining = str.slice(j)\n var check = width ? remaining.substr(0, width) : remaining\n var match = regex.exec(check)\n // @todo: Make this more readable\n var key = digit !== undefined\n ? digit\n : retArr.length\n var testNull = retArr[key] = match\n ? (cb\n ? cb.apply(null, match)\n : match[0])\n : null\n if (testNull === null) {\n throw new Error('No match in string')\n }\n return j + match[0].length\n }\n return j\n }\n\n if (arguments.length < 2) {\n throw new Error('Not enough arguments passed to sscanf')\n }\n\n // PROCESS\n for (var i = 0, j = 0; i < format.length; i++) {\n var width = 0\n var assign = true\n\n if (format.charAt(i) === '%') {\n if (format.charAt(i + 1) === '%') {\n if (str.charAt(j) === '%') {\n // a matched percent literal\n // skip beyond duplicated percent\n ++i\n ++j\n continue\n }\n // Format indicated a percent literal, but not actually present\n return _setExtraConversionSpecs(i + 2)\n }\n\n // CHARACTER FOLLOWING PERCENT IS NOT A PERCENT\n\n // We need 'g' set to get lastIndex\n var prePattern = new RegExp('^(?:(\\\\d+)\\\\$)?(\\\\*)?(\\\\d*)([hlL]?)', 'g')\n\n var preConvs = prePattern.exec(format.slice(i + 1))\n\n var tmpDigit = digit\n if (tmpDigit && preConvs[1] === undefined) {\n var msg = 'All groups in sscanf() must be expressed as numeric if '\n msg += 'any have already been used'\n throw new Error(msg)\n }\n digit = preConvs[1] ? parseInt(preConvs[1], 10) - 1 : undefined\n\n assign = !preConvs[2]\n width = parseInt(preConvs[3], 10)\n var sizeCode = preConvs[4]\n i += prePattern.lastIndex\n\n // @todo: Does PHP do anything with these? Seems not to matter\n if (sizeCode) {\n // This would need to be processed later\n switch (sizeCode) {\n case 'h':\n case 'l':\n case 'L':\n // Treats subsequent as short int (for d,i,n) or unsigned short int (for o,u,x)\n // Treats subsequent as long int (for d,i,n), or unsigned long int (for o,u,x);\n // or as double (for e,f,g) instead of float or wchar_t instead of char\n // Treats subsequent as long double (for e,f,g)\n break\n default:\n throw new Error('Unexpected size specifier in sscanf()!')\n }\n }\n // PROCESS CHARACTER\n try {\n // For detailed explanations, see http://web.archive.org/web/20031128125047/http://www.uwm.edu/cgi-bin/IMT/wwwman?topic=scanf%283%29&msection=\n // Also http://www.mathworks.com/access/helpdesk/help/techdoc/ref/sscanf.html\n // p, S, C arguments in C function not available\n // DOCUMENTED UNDER SSCANF\n switch (format.charAt(i + 1)) {\n case 'F':\n // Not supported in PHP sscanf; the argument is treated as a float, and\n // presented as a floating-point number (non-locale aware)\n // sscanf doesn't support locales, so no need for two (see %f)\n break\n case 'g':\n // Not supported in PHP sscanf; shorter of %e and %f\n // Irrelevant to input conversion\n break\n case 'G':\n // Not supported in PHP sscanf; shorter of %E and %f\n // Irrelevant to input conversion\n break\n case 'b':\n // Not supported in PHP sscanf; the argument is treated as an integer,\n // and presented as a binary number\n // Not supported - couldn't distinguish from other integers\n break\n case 'i':\n // Integer with base detection (Equivalent of 'd', but base 0 instead of 10)\n var pattern = /([+-])?(?:(?:0x([\\da-fA-F]+))|(?:0([0-7]+))|(\\d+))/\n j = _addNext(j, pattern, function (num, sign, hex,\n oct, dec) {\n return hex ? parseInt(num, 16) : oct ? parseInt(num, 8) : parseInt(num, 10)\n })\n break\n case 'n':\n // Number of characters processed so far\n retArr[digit !== undefined ? digit : retArr.length - 1] = j\n break\n // DOCUMENTED UNDER SPRINTF\n case 'c':\n // Get character; suppresses skipping over whitespace!\n // (but shouldn't be whitespace in format anyways, so no difference here)\n // Non-greedy match\n j = _addNext(j, new RegExp('.{1,' + (width || 1) + '}'))\n break\n case 'D':\n case 'd':\n // sscanf documented decimal number; equivalent of 'd';\n // Optionally signed decimal integer\n j = _addNext(j, /([+-])?(?:0*)(\\d+)/, function (num, sign, dec) {\n // Ignores initial zeroes, unlike %i and parseInt()\n var decInt = parseInt((sign || '') + dec, 10)\n if (decInt < 0) {\n // PHP also won't allow less than -2147483648\n // integer overflow with negative\n return decInt < -2147483648 ? -2147483648 : decInt\n } else {\n // PHP also won't allow greater than -2147483647\n return decInt < 2147483647 ? decInt : 2147483647\n }\n })\n break\n case 'f':\n case 'E':\n case 'e':\n // Although sscanf doesn't support locales,\n // this is used instead of '%F'; seems to be same as %e\n // These don't discriminate here as both allow exponential float of either case\n j = _addNext(j, /([+-])?(?:0*)(\\d*\\.?\\d*(?:[eE]?\\d+)?)/, function (num, sign, dec) {\n if (dec === '.') {\n return null\n }\n // Ignores initial zeroes, unlike %i and parseFloat()\n return parseFloat((sign || '') + dec)\n })\n break\n case 'u':\n // unsigned decimal integer\n // We won't deal with integer overflows due to signs\n j = _addNext(j, /([+-])?(?:0*)(\\d+)/, function (num, sign, dec) {\n // Ignores initial zeroes, unlike %i and parseInt()\n var decInt = parseInt(dec, 10)\n if (sign === '-') {\n // PHP also won't allow greater than 4294967295\n // integer overflow with negative\n return 4294967296 - decInt\n } else {\n return decInt < 4294967295 ? decInt : 4294967295\n }\n })\n break\n case 'o':\n // Octal integer // @todo: add overflows as above?\n j = _addNext(j, /([+-])?(?:0([0-7]+))/, function (num, sign, oct) {\n return parseInt(num, 8)\n })\n break\n case 's':\n // Greedy match\n j = _addNext(j, /\\S+/)\n break\n case 'X':\n case 'x':\n // Same as 'x'?\n // @todo: add overflows as above?\n // Initial 0x not necessary here\n j = _addNext(j, /([+-])?(?:(?:0x)?([\\da-fA-F]+))/, function (num, sign, hex) {\n return parseInt(num, 16)\n })\n break\n case '':\n // If no character left in expression\n throw new Error('Missing character after percent mark in sscanf() format argument')\n default:\n throw new Error('Unrecognized character after percent mark in sscanf() format argument')\n }\n } catch (e) {\n if (e === 'No match in string') {\n // Allow us to exit\n return _setExtraConversionSpecs(i + 2)\n }\n // Calculate skipping beyond initial percent too\n }\n ++i\n } else if (format.charAt(i) !== str.charAt(j)) {\n // @todo: Double-check i whitespace ignored in string and/or formats\n _NWS.lastIndex = 0\n if ((_NWS)\n .test(str.charAt(j)) || str.charAt(j) === '') {\n // Whitespace doesn't need to be an exact match)\n return _setExtraConversionSpecs(i + 1)\n } else {\n // Adjust strings when encounter non-matching whitespace,\n // so they align in future checks above\n // Ok to replace with j++;?\n str = str.slice(0, j) + str.slice(j + 1)\n i--\n }\n } else {\n j++\n }\n }\n\n // POST-PROCESSING\n return _finish()\n}\n"]}
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/str_getcsv.js b/node_modules/locutus/php/strings/str_getcsv.js new file mode 100644 index 0000000..c0c5333 --- /dev/null +++ b/node_modules/locutus/php/strings/str_getcsv.js @@ -0,0 +1,55 @@ +'use strict'; + +module.exports = function str_getcsv(input, delimiter, enclosure, escape) { + // eslint-disable-line camelcase + // discuss at: http://locutus.io/php/str_getcsv/ + // original by: Brett Zamir (http://brett-zamir.me) + // example 1: str_getcsv('"abc","def","ghi"') + // returns 1: ['abc', 'def', 'ghi'] + // example 2: str_getcsv('"row2""cell1","row2cell2","row2cell3"', null, null, '"') + // returns 2: ['row2"cell1', 'row2cell2', 'row2cell3'] + + /* + // These test cases allowing for missing delimiters are not currently supported + str_getcsv('"row2""cell1",row2cell2,row2cell3', null, null, '"'); + ['row2"cell1', 'row2cell2', 'row2cell3'] + str_getcsv('row1cell1,"row1,cell2",row1cell3', null, null, '"'); + ['row1cell1', 'row1,cell2', 'row1cell3'] + str_getcsv('"row2""cell1",row2cell2,"row2""""cell3"'); + ['row2"cell1', 'row2cell2', 'row2""cell3'] + str_getcsv('row1cell1,"row1,cell2","row1"",""cell3"', null, null, '"'); + ['row1cell1', 'row1,cell2', 'row1","cell3']; + Should also test newlines within + */ + + var i; + var inpLen; + var output = []; + var _backwards = function _backwards(str) { + // We need to go backwards to simulate negative look-behind (don't split on + // an escaped enclosure even if followed by the delimiter and another enclosure mark) + return str.split('').reverse().join(''); + }; + var _pq = function _pq(str) { + // preg_quote() + return String(str).replace(/([\\.+*?[^\]$(){}=!<>|:])/g, '\\$1'); + }; + + delimiter = delimiter || ','; + enclosure = enclosure || '"'; + escape = escape || '\\'; + var pqEnc = _pq(enclosure); + var pqEsc = _pq(escape); + + input = input.replace(new RegExp('^\\s*' + pqEnc), '').replace(new RegExp(pqEnc + '\\s*$'), ''); + + // PHP behavior may differ by including whitespace even outside of the enclosure + input = _backwards(input).split(new RegExp(pqEnc + '\\s*' + _pq(delimiter) + '\\s*' + pqEnc + '(?!' + pqEsc + ')', 'g')).reverse(); + + for (i = 0, inpLen = input.length; i < inpLen; i++) { + output.push(_backwards(input[i]).replace(new RegExp(pqEsc + pqEnc, 'g'), enclosure)); + } + + return output; +}; +//# sourceMappingURL=str_getcsv.js.map
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/str_getcsv.js.map b/node_modules/locutus/php/strings/str_getcsv.js.map new file mode 100644 index 0000000..55aee39 --- /dev/null +++ b/node_modules/locutus/php/strings/str_getcsv.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/php/strings/str_getcsv.js"],"names":["module","exports","str_getcsv","input","delimiter","enclosure","escape","i","inpLen","output","_backwards","str","split","reverse","join","_pq","String","replace","pqEnc","pqEsc","RegExp","length","push"],"mappings":";;AAAAA,OAAOC,OAAP,GAAiB,SAASC,UAAT,CAAqBC,KAArB,EAA4BC,SAA5B,EAAuCC,SAAvC,EAAkDC,MAAlD,EAA0D;AAAE;AAC3E;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;;AAiBA,MAAIC,CAAJ;AACA,MAAIC,MAAJ;AACA,MAAIC,SAAS,EAAb;AACA,MAAIC,aAAa,SAAbA,UAAa,CAAUC,GAAV,EAAe;AAC9B;AACA;AACA,WAAOA,IAAIC,KAAJ,CAAU,EAAV,EAAcC,OAAd,GAAwBC,IAAxB,CAA6B,EAA7B,CAAP;AACD,GAJD;AAKA,MAAIC,MAAM,SAANA,GAAM,CAAUJ,GAAV,EAAe;AACvB;AACA,WAAOK,OAAOL,GAAP,EAAYM,OAAZ,CAAoB,4BAApB,EAAkD,MAAlD,CAAP;AACD,GAHD;;AAKAb,cAAYA,aAAa,GAAzB;AACAC,cAAYA,aAAa,GAAzB;AACAC,WAASA,UAAU,IAAnB;AACA,MAAIY,QAAQH,IAAIV,SAAJ,CAAZ;AACA,MAAIc,QAAQJ,IAAIT,MAAJ,CAAZ;;AAEAH,UAAQA,MACLc,OADK,CACG,IAAIG,MAAJ,CAAW,UAAUF,KAArB,CADH,EACgC,EADhC,EAELD,OAFK,CAEG,IAAIG,MAAJ,CAAWF,QAAQ,OAAnB,CAFH,EAEgC,EAFhC,CAAR;;AAIA;AACAf,UAAQO,WAAWP,KAAX,EACLS,KADK,CACC,IAAIQ,MAAJ,CAAWF,QAAQ,MAAR,GAAiBH,IAAIX,SAAJ,CAAjB,GAAkC,MAAlC,GAA2Cc,KAA3C,GAAmD,KAAnD,GAA2DC,KAA3D,GAAmE,GAA9E,EAAmF,GAAnF,CADD,EAELN,OAFK,EAAR;;AAIA,OAAKN,IAAI,CAAJ,EAAOC,SAASL,MAAMkB,MAA3B,EAAmCd,IAAIC,MAAvC,EAA+CD,GAA/C,EAAoD;AAClDE,WAAOa,IAAP,CAAYZ,WAAWP,MAAMI,CAAN,CAAX,EACTU,OADS,CACD,IAAIG,MAAJ,CAAWD,QAAQD,KAAnB,EAA0B,GAA1B,CADC,EAC+Bb,SAD/B,CAAZ;AAED;;AAED,SAAOI,MAAP;AACD,CA3DD","file":"str_getcsv.js","sourcesContent":["module.exports = function str_getcsv (input, delimiter, enclosure, escape) { // eslint-disable-line camelcase\n // discuss at: http://locutus.io/php/str_getcsv/\n // original by: Brett Zamir (http://brett-zamir.me)\n // example 1: str_getcsv('\"abc\",\"def\",\"ghi\"')\n // returns 1: ['abc', 'def', 'ghi']\n // example 2: str_getcsv('\"row2\"\"cell1\",\"row2cell2\",\"row2cell3\"', null, null, '\"')\n // returns 2: ['row2\"cell1', 'row2cell2', 'row2cell3']\n\n /*\n // These test cases allowing for missing delimiters are not currently supported\n str_getcsv('\"row2\"\"cell1\",row2cell2,row2cell3', null, null, '\"');\n ['row2\"cell1', 'row2cell2', 'row2cell3']\n\n str_getcsv('row1cell1,\"row1,cell2\",row1cell3', null, null, '\"');\n ['row1cell1', 'row1,cell2', 'row1cell3']\n\n str_getcsv('\"row2\"\"cell1\",row2cell2,\"row2\"\"\"\"cell3\"');\n ['row2\"cell1', 'row2cell2', 'row2\"\"cell3']\n\n str_getcsv('row1cell1,\"row1,cell2\",\"row1\"\",\"\"cell3\"', null, null, '\"');\n ['row1cell1', 'row1,cell2', 'row1\",\"cell3'];\n\n Should also test newlines within\n */\n\n var i\n var inpLen\n var output = []\n var _backwards = function (str) {\n // We need to go backwards to simulate negative look-behind (don't split on\n // an escaped enclosure even if followed by the delimiter and another enclosure mark)\n return str.split('').reverse().join('')\n }\n var _pq = function (str) {\n // preg_quote()\n return String(str).replace(/([\\\\.+*?[^\\]$(){}=!<>|:])/g, '\\\\$1')\n }\n\n delimiter = delimiter || ','\n enclosure = enclosure || '\"'\n escape = escape || '\\\\'\n var pqEnc = _pq(enclosure)\n var pqEsc = _pq(escape)\n\n input = input\n .replace(new RegExp('^\\\\s*' + pqEnc), '')\n .replace(new RegExp(pqEnc + '\\\\s*$'), '')\n\n // PHP behavior may differ by including whitespace even outside of the enclosure\n input = _backwards(input)\n .split(new RegExp(pqEnc + '\\\\s*' + _pq(delimiter) + '\\\\s*' + pqEnc + '(?!' + pqEsc + ')', 'g'))\n .reverse()\n\n for (i = 0, inpLen = input.length; i < inpLen; i++) {\n output.push(_backwards(input[i])\n .replace(new RegExp(pqEsc + pqEnc, 'g'), enclosure))\n }\n\n return output\n}\n"]}
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/str_ireplace.js b/node_modules/locutus/php/strings/str_ireplace.js new file mode 100644 index 0000000..63694c3 --- /dev/null +++ b/node_modules/locutus/php/strings/str_ireplace.js @@ -0,0 +1,102 @@ +'use strict'; + +var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; + +module.exports = function str_ireplace(search, replace, subject, countObj) { + // eslint-disable-line camelcase + // discuss at: http://locutus.io/php/str_ireplace/ + // original by: Glen Arason (http://CanadianDomainRegistry.ca) + // note 1: Case-insensitive version of str_replace() + // note 1: Compliant with PHP 5.0 str_ireplace() Full details at: + // note 1: http://ca3.php.net/manual/en/function.str-ireplace.php + // note 2: The countObj parameter (optional) if used must be passed in as a + // note 2: object. The count will then be written by reference into it's `value` property + // example 1: str_ireplace('M', 'e', 'name') + // returns 1: 'naee' + // example 2: var $countObj = {} + // example 2: str_ireplace('M', 'e', 'name', $countObj) + // example 2: var $result = $countObj.value + // returns 2: 1 + + var i = 0; + var j = 0; + var temp = ''; + var repl = ''; + var sl = 0; + var fl = 0; + var f = ''; + var r = ''; + var s = ''; + var ra = ''; + var otemp = ''; + var oi = ''; + var ofjl = ''; + var os = subject; + var osa = Object.prototype.toString.call(os) === '[object Array]'; + // var sa = '' + + if ((typeof search === 'undefined' ? 'undefined' : _typeof(search)) === 'object') { + temp = search; + search = []; + for (i = 0; i < temp.length; i += 1) { + search[i] = temp[i].toLowerCase(); + } + } else { + search = search.toLowerCase(); + } + + if ((typeof subject === 'undefined' ? 'undefined' : _typeof(subject)) === 'object') { + temp = subject; + subject = []; + for (i = 0; i < temp.length; i += 1) { + subject[i] = temp[i].toLowerCase(); + } + } else { + subject = subject.toLowerCase(); + } + + if ((typeof search === 'undefined' ? 'undefined' : _typeof(search)) === 'object' && typeof replace === 'string') { + temp = replace; + replace = []; + for (i = 0; i < search.length; i += 1) { + replace[i] = temp; + } + } + + temp = ''; + f = [].concat(search); + r = [].concat(replace); + ra = Object.prototype.toString.call(r) === '[object Array]'; + s = subject; + // sa = Object.prototype.toString.call(s) === '[object Array]' + s = [].concat(s); + os = [].concat(os); + + if (countObj) { + countObj.value = 0; + } + + for (i = 0, sl = s.length; i < sl; i++) { + if (s[i] === '') { + continue; + } + for (j = 0, fl = f.length; j < fl; j++) { + temp = s[i] + ''; + repl = ra ? r[j] !== undefined ? r[j] : '' : r[0]; + s[i] = temp.split(f[j]).join(repl); + otemp = os[i] + ''; + oi = temp.indexOf(f[j]); + ofjl = f[j].length; + if (oi >= 0) { + os[i] = otemp.split(otemp.substr(oi, ofjl)).join(repl); + } + + if (countObj) { + countObj.value += temp.split(f[j]).length - 1; + } + } + } + + return osa ? os : os[0]; +}; +//# sourceMappingURL=str_ireplace.js.map
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/str_ireplace.js.map b/node_modules/locutus/php/strings/str_ireplace.js.map new file mode 100644 index 0000000..1e417d1 --- /dev/null +++ b/node_modules/locutus/php/strings/str_ireplace.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/php/strings/str_ireplace.js"],"names":["module","exports","str_ireplace","search","replace","subject","countObj","i","j","temp","repl","sl","fl","f","r","s","ra","otemp","oi","ofjl","os","osa","Object","prototype","toString","call","length","toLowerCase","concat","value","undefined","split","join","indexOf","substr"],"mappings":";;;;AAAAA,OAAOC,OAAP,GAAiB,SAASC,YAAT,CAAuBC,MAAvB,EAA+BC,OAA/B,EAAwCC,OAAxC,EAAiDC,QAAjD,EAA2D;AAAE;AAC5E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,MAAIC,IAAI,CAAR;AACA,MAAIC,IAAI,CAAR;AACA,MAAIC,OAAO,EAAX;AACA,MAAIC,OAAO,EAAX;AACA,MAAIC,KAAK,CAAT;AACA,MAAIC,KAAK,CAAT;AACA,MAAIC,IAAI,EAAR;AACA,MAAIC,IAAI,EAAR;AACA,MAAIC,IAAI,EAAR;AACA,MAAIC,KAAK,EAAT;AAC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AOL,MAAMD,EAAN,GAAWA,GAAG,CAAH,CAAlB;AACD,CA/FD","file":"str_ireplace.js","sourcesContent":["module.exports = function str_ireplace (search, replace, subject, countObj) { // eslint-disable-line camelcase\n // discuss at: http://locutus.io/php/str_ireplace/\n // original by: Glen Arason (http://CanadianDomainRegistry.ca)\n // note 1: Case-insensitive version of str_replace()\n // note 1: Compliant with PHP 5.0 str_ireplace() Full details at:\n // note 1: http://ca3.php.net/manual/en/function.str-ireplace.php\n // note 2: The countObj parameter (optional) if used must be passed in as a\n // note 2: object. The count will then be written by reference into it's `value` property\n // example 1: str_ireplace('M', 'e', 'name')\n // returns 1: 'naee'\n // example 2: var $countObj = {}\n // example 2: str_ireplace('M', 'e', 'name', $countObj)\n // example 2: var $result = $countObj.value\n // returns 2: 1\n\n var i = 0\n var j = 0\n var temp = ''\n var repl = ''\n var sl = 0\n var fl = 0\n var f = ''\n var r = ''\n var s = ''\n var ra = ''\n var otemp = ''\n var oi = ''\n var ofjl = ''\n var os = subject\n var osa = Object.prototype.toString.call(os) === '[object Array]'\n // var sa = ''\n\n if (typeof (search) === 'object') {\n temp = search\n search = []\n for (i = 0; i < temp.length; i += 1) {\n search[i] = temp[i].toLowerCase()\n }\n } else {\n search = search.toLowerCase()\n }\n\n if (typeof (subject) === 'object') {\n temp = subject\n subject = []\n for (i = 0; i < temp.length; i += 1) {\n subject[i] = temp[i].toLowerCase()\n }\n } else {\n subject = subject.toLowerCase()\n }\n\n if (typeof (search) === 'object' && typeof (replace) === 'string') {\n temp = replace\n replace = []\n for (i = 0; i < search.length; i += 1) {\n replace[i] = temp\n }\n }\n\n temp = ''\n f = [].concat(search)\n r = [].concat(replace)\n ra = Object.prototype.toString.call(r) === '[object Array]'\n s = subject\n // sa = Object.prototype.toString.call(s) === '[object Array]'\n s = [].concat(s)\n os = [].concat(os)\n\n if (countObj) {\n countObj.value = 0\n }\n\n for (i = 0, sl = s.length; i < sl; i++) {\n if (s[i] === '') {\n continue\n }\n for (j = 0, fl = f.length; j < fl; j++) {\n temp = s[i] + ''\n repl = ra ? (r[j] !== undefined ? r[j] : '') : r[0]\n s[i] = (temp).split(f[j]).join(repl)\n otemp = os[i] + ''\n oi = temp.indexOf(f[j])\n ofjl = f[j].length\n if (oi >= 0) {\n os[i] = (otemp).split(otemp.substr(oi, ofjl)).join(repl)\n }\n\n if (countObj) {\n countObj.value += ((temp.split(f[j])).length - 1)\n }\n }\n }\n\n return osa ? os : os[0]\n}\n"]}
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/str_pad.js b/node_modules/locutus/php/strings/str_pad.js new file mode 100644 index 0000000..a3afa23 --- /dev/null +++ b/node_modules/locutus/php/strings/str_pad.js @@ -0,0 +1,49 @@ +'use strict'; + +module.exports = function str_pad(input, padLength, padString, padType) { + // eslint-disable-line camelcase + // discuss at: http://locutus.io/php/str_pad/ + // original by: Kevin van Zonneveld (http://kvz.io) + // improved by: Michael White (http://getsprink.com) + // input by: Marco van Oort + // bugfixed by: Brett Zamir (http://brett-zamir.me) + // example 1: str_pad('Kevin van Zonneveld', 30, '-=', 'STR_PAD_LEFT') + // returns 1: '-=-=-=-=-=-Kevin van Zonneveld' + // example 2: str_pad('Kevin van Zonneveld', 30, '-', 'STR_PAD_BOTH') + // returns 2: '------Kevin van Zonneveld-----' + + var half = ''; + var padToGo; + + var _strPadRepeater = function _strPadRepeater(s, len) { + var collect = ''; + + while (collect.length < len) { + collect += s; + } + collect = collect.substr(0, len); + + return collect; + }; + + input += ''; + padString = padString !== undefined ? padString : ' '; + + if (padType !== 'STR_PAD_LEFT' && padType !== 'STR_PAD_RIGHT' && padType !== 'STR_PAD_BOTH') { + padType = 'STR_PAD_RIGHT'; + } + if ((padToGo = padLength - input.length) > 0) { + if (padType === 'STR_PAD_LEFT') { + input = _strPadRepeater(padString, padToGo) + input; + } else if (padType === 'STR_PAD_RIGHT') { + input = input + _strPadRepeater(padString, padToGo); + } else if (padType === 'STR_PAD_BOTH') { + half = _strPadRepeater(padString, Math.ceil(padToGo / 2)); + input = half + input + half; + input = input.substr(0, padLength); + } + } + + return input; +}; +//# sourceMappingURL=str_pad.js.map
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/str_pad.js.map b/node_modules/locutus/php/strings/str_pad.js.map new file mode 100644 index 0000000..7d64352 --- /dev/null +++ b/node_modules/locutus/php/strings/str_pad.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/php/strings/str_pad.js"],"names":["module","exports","str_pad","input","padLength","padString","padType","half","padToGo","_strPadRepeater","s","len","collect","length","substr","undefined","Math","ceil"],"mappings":";;AAAAA,OAAOC,OAAP,GAAiB,SAASC,OAAT,CAAkBC,KAAlB,EAAyBC,SAAzB,EAAoCC,SAApC,EAA+CC,OAA/C,EAAwD;AAAE;AACzE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,MAAIC,OAAO,EAAX;AACA,MAAIC,OAAJ;;AAEA,MAAIC,kBAAkB,SAAlBA,eAAkB,CAAUC,CAAV,EAAaC,GAAb,EAAkB;AACtC,QAAIC,UAAU,EAAd;;AAEA,WAAOA,QAAQC,MAAR,GAAiBF,GAAxB,EAA6B;AAC3BC,iBAAWF,CAAX;AACD;AACDE,cAAUA,QAAQE,MAAR,CAAe,CAAf,EAAkBH,GAAlB,CAAV;;AAEA,WAAOC,OAAP;AACD,GATD;;AAWAT,WAAS,EAAT;AACAE,cAAYA,cAAcU,SAAd,GAA0BV,SAA1B,GAAsC,GAAlD;;AAEA,MAAIC,YAAY,cAAZ,IAA8BA,YAAY,eAA1C,IAA6DA,YAAY,cAA7E,EAA6F;AAC3FA,cAAU,eAAV;AACD;AACD,MAAI,CAACE,UAAUJ,YAAYD,MAAMU,MAA7B,IAAuC,CAA3C,EAA8C;AAC5C,QAAIP,YAAY,cAAhB,EAAgC;AAC9BH,cAAQM,gBAAgBJ,SAAhB,EAA2BG,OAA3B,IAAsCL,KAA9C;AACD,KAFD,MAEO,IAAIG,YAAY,eAAhB,EAAiC;AACtCH,cAAQA,QAAQM,gBAAgBJ,SAAhB,EAA2BG,OAA3B,CAAhB;AACD,KAFM,MAEA,IAAIF,YAAY,cAAhB,EAAgC;AACrCC,aAAOE,gBAAgBJ,SAAhB,EAA2BW,KAAKC,IAAL,CAAUT,UAAU,CAApB,CAA3B,CAAP;AACAL,cAAQI,OAAOJ,KAAP,GAAeI,IAAvB;AACAJ,cAAQA,MAAMW,MAAN,CAAa,CAAb,EAAgBV,SAAhB,CAAR;AACD;AACF;;AAED,SAAOD,KAAP;AACD,CA5CD","file":"str_pad.js","sourcesContent":["module.exports = function str_pad (input, padLength, padString, padType) { // eslint-disable-line camelcase\n // discuss at: http://locutus.io/php/str_pad/\n // original by: Kevin van Zonneveld (http://kvz.io)\n // improved by: Michael White (http://getsprink.com)\n // input by: Marco van Oort\n // bugfixed by: Brett Zamir (http://brett-zamir.me)\n // example 1: str_pad('Kevin van Zonneveld', 30, '-=', 'STR_PAD_LEFT')\n // returns 1: '-=-=-=-=-=-Kevin van Zonneveld'\n // example 2: str_pad('Kevin van Zonneveld', 30, '-', 'STR_PAD_BOTH')\n // returns 2: '------Kevin van Zonneveld-----'\n\n var half = ''\n var padToGo\n\n var _strPadRepeater = function (s, len) {\n var collect = ''\n\n while (collect.length < len) {\n collect += s\n }\n collect = collect.substr(0, len)\n\n return collect\n }\n\n input += ''\n padString = padString !== undefined ? padString : ' '\n\n if (padType !== 'STR_PAD_LEFT' && padType !== 'STR_PAD_RIGHT' && padType !== 'STR_PAD_BOTH') {\n padType = 'STR_PAD_RIGHT'\n }\n if ((padToGo = padLength - input.length) > 0) {\n if (padType === 'STR_PAD_LEFT') {\n input = _strPadRepeater(padString, padToGo) + input\n } else if (padType === 'STR_PAD_RIGHT') {\n input = input + _strPadRepeater(padString, padToGo)\n } else if (padType === 'STR_PAD_BOTH') {\n half = _strPadRepeater(padString, Math.ceil(padToGo / 2))\n input = half + input + half\n input = input.substr(0, padLength)\n }\n }\n\n return input\n}\n"]}
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/str_repeat.js b/node_modules/locutus/php/strings/str_repeat.js new file mode 100644 index 0000000..b8df8a7 --- /dev/null +++ b/node_modules/locutus/php/strings/str_repeat.js @@ -0,0 +1,26 @@ +'use strict'; + +module.exports = function str_repeat(input, multiplier) { + // eslint-disable-line camelcase + // discuss at: http://locutus.io/php/str_repeat/ + // original by: Kevin van Zonneveld (http://kvz.io) + // improved by: Jonas Raoni Soares Silva (http://www.jsfromhell.com) + // improved by: Ian Carter (http://euona.com/) + // example 1: str_repeat('-=', 10) + // returns 1: '-=-=-=-=-=-=-=-=-=-=' + + var y = ''; + while (true) { + if (multiplier & 1) { + y += input; + } + multiplier >>= 1; + if (multiplier) { + input += input; + } else { + break; + } + } + return y; +}; +//# sourceMappingURL=str_repeat.js.map
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/str_repeat.js.map b/node_modules/locutus/php/strings/str_repeat.js.map new file mode 100644 index 0000000..773b6b0 --- /dev/null +++ b/node_modules/locutus/php/strings/str_repeat.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/php/strings/str_repeat.js"],"names":["module","exports","str_repeat","input","multiplier","y"],"mappings":";;AAAAA,OAAOC,OAAP,GAAiB,SAASC,UAAT,CAAqBC,KAArB,EAA4BC,UAA5B,EAAwC;AAAE;AACzD;AACA;AACA;AACA;AACA;AACA;;AAEA,MAAIC,IAAI,EAAR;AACA,SAAO,IAAP,EAAa;AACX,QAAID,aAAa,CAAjB,EAAoB;AAClBC,WAAKF,KAAL;AACD;AACDC,mBAAe,CAAf;AACA,QAAIA,UAAJ,EAAgB;AACdD,eAASA,KAAT;AACD,KAFD,MAEO;AACL;AACD;AACF;AACD,SAAOE,CAAP;AACD,CArBD","file":"str_repeat.js","sourcesContent":["module.exports = function str_repeat (input, multiplier) { // eslint-disable-line camelcase\n // discuss at: http://locutus.io/php/str_repeat/\n // original by: Kevin van Zonneveld (http://kvz.io)\n // improved by: Jonas Raoni Soares Silva (http://www.jsfromhell.com)\n // improved by: Ian Carter (http://euona.com/)\n // example 1: str_repeat('-=', 10)\n // returns 1: '-=-=-=-=-=-=-=-=-=-='\n\n var y = ''\n while (true) {\n if (multiplier & 1) {\n y += input\n }\n multiplier >>= 1\n if (multiplier) {\n input += input\n } else {\n break\n }\n }\n return y\n}\n"]}
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/str_replace.js b/node_modules/locutus/php/strings/str_replace.js new file mode 100644 index 0000000..2ced641 --- /dev/null +++ b/node_modules/locutus/php/strings/str_replace.js @@ -0,0 +1,85 @@ +'use strict'; + +var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; + +module.exports = function str_replace(search, replace, subject, countObj) { + // eslint-disable-line camelcase + // discuss at: http://locutus.io/php/str_replace/ + // original by: Kevin van Zonneveld (http://kvz.io) + // improved by: Gabriel Paderni + // improved by: Philip Peterson + // improved by: Simon Willison (http://simonwillison.net) + // improved by: Kevin van Zonneveld (http://kvz.io) + // improved by: Onno Marsman (https://twitter.com/onnomarsman) + // improved by: Brett Zamir (http://brett-zamir.me) + // revised by: Jonas Raoni Soares Silva (http://www.jsfromhell.com) + // bugfixed by: Anton Ongson + // bugfixed by: Kevin van Zonneveld (http://kvz.io) + // bugfixed by: Oleg Eremeev + // bugfixed by: Glen Arason (http://CanadianDomainRegistry.ca) + // bugfixed by: Glen Arason (http://CanadianDomainRegistry.ca) + // input by: Onno Marsman (https://twitter.com/onnomarsman) + // input by: Brett Zamir (http://brett-zamir.me) + // input by: Oleg Eremeev + // note 1: The countObj parameter (optional) if used must be passed in as a + // note 1: object. The count will then be written by reference into it's `value` property + // example 1: str_replace(' ', '.', 'Kevin van Zonneveld') + // returns 1: 'Kevin.van.Zonneveld' + // example 2: str_replace(['{name}', 'l'], ['hello', 'm'], '{name}, lars') + // returns 2: 'hemmo, mars' + // example 3: str_replace(Array('S','F'),'x','ASDFASDF') + // returns 3: 'AxDxAxDx' + // example 4: var countObj = {} + // example 4: str_replace(['A','D'], ['x','y'] , 'ASDFASDF' , countObj) + // example 4: var $result = countObj.value + // returns 4: 4 + + var i = 0; + var j = 0; + var temp = ''; + var repl = ''; + var sl = 0; + var fl = 0; + var f = [].concat(search); + var r = [].concat(replace); + var s = subject; + var ra = Object.prototype.toString.call(r) === '[object Array]'; + var sa = Object.prototype.toString.call(s) === '[object Array]'; + s = [].concat(s); + + var $global = typeof window !== 'undefined' ? window : global; + $global.$locutus = $global.$locutus || {}; + var $locutus = $global.$locutus; + $locutus.php = $locutus.php || {}; + + if ((typeof search === 'undefined' ? 'undefined' : _typeof(search)) === 'object' && typeof replace === 'string') { + temp = replace; + replace = []; + for (i = 0; i < search.length; i += 1) { + replace[i] = temp; + } + temp = ''; + r = [].concat(replace); + ra = Object.prototype.toString.call(r) === '[object Array]'; + } + + if (typeof countObj !== 'undefined') { + countObj.value = 0; + } + + for (i = 0, sl = s.length; i < sl; i++) { + if (s[i] === '') { + continue; + } + for (j = 0, fl = f.length; j < fl; j++) { + temp = s[i] + ''; + repl = ra ? r[j] !== undefined ? r[j] : '' : r[0]; + s[i] = temp.split(f[j]).join(repl); + if (typeof countObj !== 'undefined') { + countObj.value += temp.split(f[j]).length - 1; + } + } + } + return sa ? s : s[0]; +}; +//# sourceMappingURL=str_replace.js.map
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/str_replace.js.map b/node_modules/locutus/php/strings/str_replace.js.map new file mode 100644 index 0000000..bcb40d7 --- /dev/null +++ b/node_modules/locutus/php/strings/str_replace.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/php/strings/str_replace.js"],"names":["module","exports","str_replace","search","replace","subject","countObj","i","j","temp","repl","sl","fl","f","concat","r","s","ra","Object","prototype","toString","call","sa","$global","window","global","$locutus","php","length","value","undefined","split","join"],"mappings":";;;;AAAAA,OAAOC,OAAP,GAAiB,SAASC,WAAT,CAA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,GAAGD,MAAH,CAAUV,OAAV,CAAJ;AACAa,SAAKC,OAAOC,SAAP,CAAiBC,QAAjB,CAA0BC,IAA1B,CAA+BN,CAA/B,MAAsC,gBAA3C;AACD;;AAED,MAAI,OAAOT,QAAP,KAAoB,WAAxB,EAAqC;AACnCA,aAASuB,KAAT,GAAiB,CAAjB;AACD;;AAED,OAAKtB,IAAI,CAAJ,EAAOI,KAAKK,EAAEY,MAAnB,EAA2BrB,IAAII,EAA/B,EAAmCJ,GAAnC,EAAwC;AACtC,QAAIS,EAAET,CAAF,MAAS,EAAb,EAAiB;AACf;AACD;AACD,SAAKC,IAAI,CAAJ,EAAOI,KAAKC,EAAEe,MAAnB,EAA2BpB,IAAII,EAA/B,EAAmCJ,GAAnC,EAAwC;AACtCC,aAAOO,EAAET,CAAF,IAAO,EAAd;AACAG,aAAOO,KAAMF,EAAEP,CAAF,MAASsB,SAAT,GAAqBf,EAAEP,CAAF,CAArB,GAA4B,EAAlC,GAAwCO,EAAE,CAAF,CAA/C;AACAC,QAAET,CAAF,IAAQE,IAAD,CAAOsB,KAAP,CAAalB,EAAEL,CAAF,CAAb,EAAmBwB,IAAnB,CAAwBtB,IAAxB,CAAP;AACA,UAAI,OAAOJ,QAAP,KAAoB,WAAxB,EAAqC;AACnCA,iBAASuB,KAAT,IAAoBpB,KAAKsB,KAAL,CAAWlB,EAAEL,CAAF,CAAX,CAAD,CAAmBoB,MAAnB,GAA4B,CAA/C;AACD;AACF;AACF;AACD,SAAON,KAAKN,CAAL,GAASA,EAAE,CAAF,CAAhB;AACD,CA9ED","file":"str_replace.js","sourcesContent":["module.exports = function str_replace (search, replace, subject, countObj) { // eslint-disable-line camelcase\n // discuss at: http://locutus.io/php/str_replace/\n // original by: Kevin van Zonneveld (http://kvz.io)\n // improved by: Gabriel Paderni\n // improved by: Philip Peterson\n // improved by: Simon Willison (http://simonwillison.net)\n // improved by: Kevin van Zonneveld (http://kvz.io)\n // improved by: Onno Marsman (https://twitter.com/onnomarsman)\n // improved by: Brett Zamir (http://brett-zamir.me)\n // revised by: Jonas Raoni Soares Silva (http://www.jsfromhell.com)\n // bugfixed by: Anton Ongson\n // bugfixed by: Kevin van Zonneveld (http://kvz.io)\n // bugfixed by: Oleg Eremeev\n // bugfixed by: Glen Arason (http://CanadianDomainRegistry.ca)\n // bugfixed by: Glen Arason (http://CanadianDomainRegistry.ca)\n // input by: Onno Marsman (https://twitter.com/onnomarsman)\n // input by: Brett Zamir (http://brett-zamir.me)\n // input by: Oleg Eremeev\n // note 1: The countObj parameter (optional) if used must be passed in as a\n // note 1: object. The count will then be written by reference into it's `value` property\n // example 1: str_replace(' ', '.', 'Kevin van Zonneveld')\n // returns 1: 'Kevin.van.Zonneveld'\n // example 2: str_replace(['{name}', 'l'], ['hello', 'm'], '{name}, lars')\n // returns 2: 'hemmo, mars'\n // example 3: str_replace(Array('S','F'),'x','ASDFASDF')\n // returns 3: 'AxDxAxDx'\n // example 4: var countObj = {}\n // example 4: str_replace(['A','D'], ['x','y'] , 'ASDFASDF' , countObj)\n // example 4: var $result = countObj.value\n // returns 4: 4\n\n var i = 0\n var j = 0\n var temp = ''\n var repl = ''\n var sl = 0\n var fl = 0\n var f = [].concat(search)\n var r = [].concat(replace)\n var s = subject\n var ra = Object.prototype.toString.call(r) === '[object Array]'\n var sa = Object.prototype.toString.call(s) === '[object Array]'\n s = [].concat(s)\n\n var $global = (typeof window !== 'undefined' ? window : global)\n $global.$locutus = $global.$locutus || {}\n var $locutus = $global.$locutus\n $locutus.php = $locutus.php || {}\n\n if (typeof (search) === 'object' && typeof (replace) === 'string') {\n temp = replace\n replace = []\n for (i = 0; i < search.length; i += 1) {\n replace[i] = temp\n }\n temp = ''\n r = [].concat(replace)\n ra = Object.prototype.toString.call(r) === '[object Array]'\n }\n\n if (typeof countObj !== 'undefined') {\n countObj.value = 0\n }\n\n for (i = 0, sl = s.length; i < sl; i++) {\n if (s[i] === '') {\n continue\n }\n for (j = 0, fl = f.length; j < fl; j++) {\n temp = s[i] + ''\n repl = ra ? (r[j] !== undefined ? r[j] : '') : r[0]\n s[i] = (temp).split(f[j]).join(repl)\n if (typeof countObj !== 'undefined') {\n countObj.value += ((temp.split(f[j])).length - 1)\n }\n }\n }\n return sa ? s : s[0]\n}\n"]}
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/str_rot13.js b/node_modules/locutus/php/strings/str_rot13.js new file mode 100644 index 0000000..3c378c9 --- /dev/null +++ b/node_modules/locutus/php/strings/str_rot13.js @@ -0,0 +1,21 @@ +'use strict'; + +module.exports = function str_rot13(str) { + // eslint-disable-line camelcase + // discuss at: http://locutus.io/php/str_rot13/ + // original by: Jonas Raoni Soares Silva (http://www.jsfromhell.com) + // improved by: Ates Goral (http://magnetiq.com) + // improved by: Rafał Kukawski (http://blog.kukawski.pl) + // bugfixed by: Onno Marsman (https://twitter.com/onnomarsman) + // example 1: str_rot13('Kevin van Zonneveld') + // returns 1: 'Xriva ina Mbaariryq' + // example 2: str_rot13('Xriva ina Mbaariryq') + // returns 2: 'Kevin van Zonneveld' + // example 3: str_rot13(33) + // returns 3: '33' + + return (str + '').replace(/[a-z]/gi, function (s) { + return String.fromCharCode(s.charCodeAt(0) + (s.toLowerCase() < 'n' ? 13 : -13)); + }); +}; +//# sourceMappingURL=str_rot13.js.map
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/str_rot13.js.map b/node_modules/locutus/php/strings/str_rot13.js.map new file mode 100644 index 0000000..ea71871 --- /dev/null +++ b/node_modules/locutus/php/strings/str_rot13.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/php/strings/str_rot13.js"],"names":["module","exports","str_rot13","str","replace","s","String","fromCharCode","charCodeAt","toLowerCase"],"mappings":";;AAAAA,OAAOC,OAAP,GAAiB,SAASC,SAAT,CAAoBC,GAApB,EAAyB;AAAE;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAAO,CAACA,MAAM,EAAP,EACJC,OADI,CACI,SADJ,EACe,UAAUC,CAAV,EAAa;AAC/B,WAAOC,OAAOC,YAAP,CAAoBF,EAAEG,UAAF,CAAa,CAAb,KAAmBH,EAAEI,WAAF,KAAkB,GAAlB,GAAwB,EAAxB,GAA6B,CAAC,EAAjD,CAApB,CAAP;AACD,GAHI,CAAP;AAID,CAjBD","file":"str_rot13.js","sourcesContent":["module.exports = function str_rot13 (str) { // eslint-disable-line camelcase\n // discuss at: http://locutus.io/php/str_rot13/\n // original by: Jonas Raoni Soares Silva (http://www.jsfromhell.com)\n // improved by: Ates Goral (http://magnetiq.com)\n // improved by: Rafał Kukawski (http://blog.kukawski.pl)\n // bugfixed by: Onno Marsman (https://twitter.com/onnomarsman)\n // example 1: str_rot13('Kevin van Zonneveld')\n // returns 1: 'Xriva ina Mbaariryq'\n // example 2: str_rot13('Xriva ina Mbaariryq')\n // returns 2: 'Kevin van Zonneveld'\n // example 3: str_rot13(33)\n // returns 3: '33'\n\n return (str + '')\n .replace(/[a-z]/gi, function (s) {\n return String.fromCharCode(s.charCodeAt(0) + (s.toLowerCase() < 'n' ? 13 : -13))\n })\n}\n"]}
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/str_shuffle.js b/node_modules/locutus/php/strings/str_shuffle.js new file mode 100644 index 0000000..ce204ba --- /dev/null +++ b/node_modules/locutus/php/strings/str_shuffle.js @@ -0,0 +1,34 @@ +'use strict'; + +module.exports = function str_shuffle(str) { + // eslint-disable-line camelcase + // discuss at: http://locutus.io/php/str_shuffle/ + // original by: Brett Zamir (http://brett-zamir.me) + // example 1: var $shuffled = str_shuffle("abcdef") + // example 1: var $result = $shuffled.length + // returns 1: 6 + + if (arguments.length === 0) { + throw new Error('Wrong parameter count for str_shuffle()'); + } + + if (str === null) { + return ''; + } + + str += ''; + + var newStr = ''; + var rand; + var i = str.length; + + while (i) { + rand = Math.floor(Math.random() * i); + newStr += str.charAt(rand); + str = str.substring(0, rand) + str.substr(rand + 1); + i--; + } + + return newStr; +}; +//# sourceMappingURL=str_shuffle.js.map
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/str_shuffle.js.map b/node_modules/locutus/php/strings/str_shuffle.js.map new file mode 100644 index 0000000..a185077 --- /dev/null +++ b/node_modules/locutus/php/strings/str_shuffle.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/php/strings/str_shuffle.js"],"names":["module","exports","str_shuffle","str","arguments","length","Error","newStr","rand","i","Math","floor","random","charAt","substring","substr"],"mappings":";;AAAAA,OAAOC,OAAP,GAAiB,SAASC,WAAT,CAAsBC,GAAtB,EAA2B;AAAE;AAC5C;AACA;AACA;AACA;AACA;;AAEA,MAAIC,UAAUC,MAAV,KAAqB,CAAzB,EAA4B;AAC1B,UAAM,IAAIC,KAAJ,CAAU,yCAAV,CAAN;AACD;;AAED,MAAIH,QAAQ,IAAZ,EAAkB;AAChB,WAAO,EAAP;AACD;;AAEDA,SAAO,EAAP;;AAEA,MAAII,SAAS,EAAb;AACA,MAAIC,IAAJ;AACA,MAAIC,IAAIN,IAAIE,MAAZ;;AAEA,SAAOI,CAAP,EAAU;AACRD,WAAOE,KAAKC,KAAL,CAAWD,KAAKE,MAAL,KAAgBH,CAA3B,CAAP;AACAF,cAAUJ,IAAIU,MAAJ,CAAWL,IAAX,CAAV;AACAL,UAAMA,IAAIW,SAAJ,CAAc,CAAd,EAAiBN,IAAjB,IAAyBL,IAAIY,MAAJ,CAAWP,OAAO,CAAlB,CAA/B;AACAC;AACD;;AAED,SAAOF,MAAP;AACD,CA7BD","file":"str_shuffle.js","sourcesContent":["module.exports = function str_shuffle (str) { // eslint-disable-line camelcase\n // discuss at: http://locutus.io/php/str_shuffle/\n // original by: Brett Zamir (http://brett-zamir.me)\n // example 1: var $shuffled = str_shuffle(\"abcdef\")\n // example 1: var $result = $shuffled.length\n // returns 1: 6\n\n if (arguments.length === 0) {\n throw new Error('Wrong parameter count for str_shuffle()')\n }\n\n if (str === null) {\n return ''\n }\n\n str += ''\n\n var newStr = ''\n var rand\n var i = str.length\n\n while (i) {\n rand = Math.floor(Math.random() * i)\n newStr += str.charAt(rand)\n str = str.substring(0, rand) + str.substr(rand + 1)\n i--\n }\n\n return newStr\n}\n"]}
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/str_split.js b/node_modules/locutus/php/strings/str_split.js new file mode 100644 index 0000000..08177e1 --- /dev/null +++ b/node_modules/locutus/php/strings/str_split.js @@ -0,0 +1,33 @@ +'use strict'; + +module.exports = function str_split(string, splitLength) { + // eslint-disable-line camelcase + // discuss at: http://locutus.io/php/str_split/ + // original by: Martijn Wieringa + // improved by: Brett Zamir (http://brett-zamir.me) + // bugfixed by: Onno Marsman (https://twitter.com/onnomarsman) + // revised by: Theriault (https://github.com/Theriault) + // revised by: Rafał Kukawski (http://blog.kukawski.pl) + // input by: Bjorn Roesbeke (http://www.bjornroesbeke.be/) + // example 1: str_split('Hello Friend', 3) + // returns 1: ['Hel', 'lo ', 'Fri', 'end'] + + if (splitLength === null) { + splitLength = 1; + } + if (string === null || splitLength < 1) { + return false; + } + + string += ''; + var chunks = []; + var pos = 0; + var len = string.length; + + while (pos < len) { + chunks.push(string.slice(pos, pos += splitLength)); + } + + return chunks; +}; +//# sourceMappingURL=str_split.js.map
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/str_split.js.map b/node_modules/locutus/php/strings/str_split.js.map new file mode 100644 index 0000000..a7f5b49 --- /dev/null +++ b/node_modules/locutus/php/strings/str_split.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/php/strings/str_split.js"],"names":["module","exports","str_split","string","splitLength","chunks","pos","len","length","push","slice"],"mappings":";;AAAAA,OAAOC,OAAP,GAAiB,SAASC,SAAT,CAAoBC,MAApB,EAA4BC,WAA5B,EAAyC;AAAE;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,MAAIA,gBAAgB,IAApB,EAA0B;AACxBA,kBAAc,CAAd;AACD;AACD,MAAID,WAAW,IAAX,IAAmBC,cAAc,CAArC,EAAwC;AACtC,WAAO,KAAP;AACD;;AAEDD,YAAU,EAAV;AACA,MAAIE,SAAS,EAAb;AACA,MAAIC,MAAM,CAAV;AACA,MAAIC,MAAMJ,OAAOK,MAAjB;;AAEA,SAAOF,MAAMC,GAAb,EAAkB;AAChBF,WAAOI,IAAP,CAAYN,OAAOO,KAAP,CAAaJ,GAAb,EAAkBA,OAAOF,WAAzB,CAAZ;AACD;;AAED,SAAOC,MAAP;AACD,CA5BD","file":"str_split.js","sourcesContent":["module.exports = function str_split (string, splitLength) { // eslint-disable-line camelcase\n // discuss at: http://locutus.io/php/str_split/\n // original by: Martijn Wieringa\n // improved by: Brett Zamir (http://brett-zamir.me)\n // bugfixed by: Onno Marsman (https://twitter.com/onnomarsman)\n // revised by: Theriault (https://github.com/Theriault)\n // revised by: Rafał Kukawski (http://blog.kukawski.pl)\n // input by: Bjorn Roesbeke (http://www.bjornroesbeke.be/)\n // example 1: str_split('Hello Friend', 3)\n // returns 1: ['Hel', 'lo ', 'Fri', 'end']\n\n if (splitLength === null) {\n splitLength = 1\n }\n if (string === null || splitLength < 1) {\n return false\n }\n\n string += ''\n var chunks = []\n var pos = 0\n var len = string.length\n\n while (pos < len) {\n chunks.push(string.slice(pos, pos += splitLength))\n }\n\n return chunks\n}\n"]}
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/str_word_count.js b/node_modules/locutus/php/strings/str_word_count.js new file mode 100644 index 0000000..c6179a2 --- /dev/null +++ b/node_modules/locutus/php/strings/str_word_count.js @@ -0,0 +1,117 @@ +'use strict'; + +module.exports = function str_word_count(str, format, charlist) { + // eslint-disable-line camelcase + // discuss at: http://locutus.io/php/str_word_count/ + // original by: Ole Vrijenhoek + // bugfixed by: Kevin van Zonneveld (http://kvz.io) + // bugfixed by: Brett Zamir (http://brett-zamir.me) + // bugfixed by: Brett Zamir (http://brett-zamir.me) + // input by: Bug? + // improved by: Brett Zamir (http://brett-zamir.me) + // example 1: str_word_count("Hello fri3nd, you're\r\n looking good today!", 1) + // returns 1: ['Hello', 'fri', 'nd', "you're", 'looking', 'good', 'today'] + // example 2: str_word_count("Hello fri3nd, you're\r\n looking good today!", 2) + // returns 2: {0: 'Hello', 6: 'fri', 10: 'nd', 14: "you're", 29: 'looking', 46: 'good', 51: 'today'} + // example 3: str_word_count("Hello fri3nd, you're\r\n looking good today!", 1, '\u00e0\u00e1\u00e3\u00e73') + // returns 3: ['Hello', 'fri3nd', "you're", 'looking', 'good', 'today'] + // example 4: str_word_count('hey', 2) + // returns 4: {0: 'hey'} + + var ctypeAlpha = require('../ctype/ctype_alpha'); + var len = str.length; + var cl = charlist && charlist.length; + var chr = ''; + var tmpStr = ''; + var i = 0; + var c = ''; + var wArr = []; + var wC = 0; + var assoc = {}; + var aC = 0; + var reg = ''; + var match = false; + + var _pregQuote = function _pregQuote(str) { + return (str + '').replace(/([\\.+*?[^\]$(){}=!<>|:])/g, '\\$1'); + }; + var _getWholeChar = function _getWholeChar(str, i) { + // Use for rare cases of non-BMP characters + var code = str.charCodeAt(i); + if (code < 0xD800 || code > 0xDFFF) { + return str.charAt(i); + } + if (code >= 0xD800 && code <= 0xDBFF) { + // High surrogate (could change last hex to 0xDB7F to treat high private surrogates as single + // characters) + if (str.length <= i + 1) { + throw new Error('High surrogate without following low surrogate'); + } + var next = str.charCodeAt(i + 1); + if (next < 0xDC00 || next > 0xDFFF) { + throw new Error('High surrogate without following low surrogate'); + } + return str.charAt(i) + str.charAt(i + 1); + } + // Low surrogate (0xDC00 <= code && code <= 0xDFFF) + if (i === 0) { + throw new Error('Low surrogate without preceding high surrogate'); + } + var prev = str.charCodeAt(i - 1); + if (prev < 0xD800 || prev > 0xDBFF) { + // (could change last hex to 0xDB7F to treat high private surrogates as single characters) + throw new Error('Low surrogate without preceding high surrogate'); + } + // We can pass over low surrogates now as the second component in a pair which we have already + // processed + return false; + }; + + if (cl) { + reg = '^(' + _pregQuote(_getWholeChar(charlist, 0)); + for (i = 1; i < cl; i++) { + if ((chr = _getWholeChar(charlist, i)) === false) { + continue; + } + reg += '|' + _pregQuote(chr); + } + reg += ')$'; + reg = new RegExp(reg); + } + + for (i = 0; i < len; i++) { + if ((c = _getWholeChar(str, i)) === false) { + continue; + } + // No hyphen at beginning or end unless allowed in charlist (or locale) + // No apostrophe at beginning unless allowed in charlist (or locale) + // @todo: Make this more readable + match = ctypeAlpha(c) || reg && c.search(reg) !== -1 || i !== 0 && i !== len - 1 && c === '-' || i !== 0 && c === "'"; + if (match) { + if (tmpStr === '' && format === 2) { + aC = i; + } + tmpStr = tmpStr + c; + } + if (i === len - 1 || !match && tmpStr !== '') { + if (format !== 2) { + wArr[wArr.length] = tmpStr; + } else { + assoc[aC] = tmpStr; + } + tmpStr = ''; + wC++; + } + } + + if (!format) { + return wC; + } else if (format === 1) { + return wArr; + } else if (format === 2) { + return assoc; + } + + throw new Error('You have supplied an incorrect format'); +}; +//# sourceMappingURL=str_word_count.js.map
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/str_word_count.js.map b/node_modules/locutus/php/strings/str_word_count.js.map new file mode 100644 index 0000000..9c959e8 --- /dev/null +++ b/node_modules/locutus/php/strings/str_word_count.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/php/strings/str_word_count.js"],"names":["module","exports","str_word_count","str","format","charlist","ctypeAlpha","require","len","length","cl","chr","tmpStr","i","c","wArr","wC","assoc","aC","reg","match","_pregQuote","replace","_getWholeChar","code","charCodeAt","charAt","Error","next","prev","RegExp","search"],"mappings":";;AAAAA,OAAOC,OAAP,GAAiB,SAASC,cAAT,CAAyBC,GAAzB,EAA8BC,MAA9B,EAAsCC,QAAtC,EAAgD;AAAE;AACjE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,MAAIC,aAAaC,QAAQ,sBAAR,CAAjB;AACA,MAAIC,MAAML,IAAIM,MAAd;AACA,MAAIC,KAAKL,YAAYA,SAASI,MAA9B;AACA,MAAIE,MAAM,EAAV;AACA,MA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,CAACZ,MAAL,EAAa;AACX,WAAOY,EAAP;AACD,GAFD,MAEO,IAAIZ,WAAW,CAAf,EAAkB;AACvB,WAAOW,IAAP;AACD,GAFM,MAEA,IAAIX,WAAW,CAAf,EAAkB;AACvB,WAAOa,KAAP;AACD;;AAED,QAAM,IAAIU,KAAJ,CAAU,uCAAV,CAAN;AACD,CAnHD","file":"str_word_count.js","sourcesContent":["module.exports = function str_word_count (str, format, charlist) { // eslint-disable-line camelcase\n // discuss at: http://locutus.io/php/str_word_count/\n // original by: Ole Vrijenhoek\n // bugfixed by: Kevin van Zonneveld (http://kvz.io)\n // bugfixed by: Brett Zamir (http://brett-zamir.me)\n // bugfixed by: Brett Zamir (http://brett-zamir.me)\n // input by: Bug?\n // improved by: Brett Zamir (http://brett-zamir.me)\n // example 1: str_word_count(\"Hello fri3nd, you're\\r\\n looking good today!\", 1)\n // returns 1: ['Hello', 'fri', 'nd', \"you're\", 'looking', 'good', 'today']\n // example 2: str_word_count(\"Hello fri3nd, you're\\r\\n looking good today!\", 2)\n // returns 2: {0: 'Hello', 6: 'fri', 10: 'nd', 14: \"you're\", 29: 'looking', 46: 'good', 51: 'today'}\n // example 3: str_word_count(\"Hello fri3nd, you're\\r\\n looking good today!\", 1, '\\u00e0\\u00e1\\u00e3\\u00e73')\n // returns 3: ['Hello', 'fri3nd', \"you're\", 'looking', 'good', 'today']\n // example 4: str_word_count('hey', 2)\n // returns 4: {0: 'hey'}\n\n var ctypeAlpha = require('../ctype/ctype_alpha')\n var len = str.length\n var cl = charlist && charlist.length\n var chr = ''\n var tmpStr = ''\n var i = 0\n var c = ''\n var wArr = []\n var wC = 0\n var assoc = {}\n var aC = 0\n var reg = ''\n var match = false\n\n var _pregQuote = function (str) {\n return (str + '').replace(/([\\\\.+*?[^\\]$(){}=!<>|:])/g, '\\\\$1')\n }\n var _getWholeChar = function (str, i) {\n // Use for rare cases of non-BMP characters\n var code = str.charCodeAt(i)\n if (code < 0xD800 || code > 0xDFFF) {\n return str.charAt(i)\n }\n if (code >= 0xD800 && code <= 0xDBFF) {\n // High surrogate (could change last hex to 0xDB7F to treat high private surrogates as single\n // characters)\n if (str.length <= (i + 1)) {\n throw new Error('High surrogate without following low surrogate')\n }\n var 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 }\n // Low surrogate (0xDC00 <= code && code <= 0xDFFF)\n if (i === 0) {\n throw new Error('Low surrogate without preceding high surrogate')\n }\n var prev = str.charCodeAt(i - 1)\n if (prev < 0xD800 || prev > 0xDBFF) {\n // (could change last hex to 0xDB7F to treat high private surrogates 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 component in a pair which we have already\n // processed\n return false\n }\n\n if (cl) {\n reg = '^(' + _pregQuote(_getWholeChar(charlist, 0))\n for (i = 1; i < cl; i++) {\n if ((chr = _getWholeChar(charlist, i)) === false) {\n continue\n }\n reg += '|' + _pregQuote(chr)\n }\n reg += ')$'\n reg = new RegExp(reg)\n }\n\n for (i = 0; i < len; i++) {\n if ((c = _getWholeChar(str, i)) === false) {\n continue\n }\n // No hyphen at beginning or end unless allowed in charlist (or locale)\n // No apostrophe at beginning unless allowed in charlist (or locale)\n // @todo: Make this more readable\n match = ctypeAlpha(c) ||\n (reg && c.search(reg) !== -1) ||\n ((i !== 0 && i !== len - 1) && c === '-') ||\n (i !== 0 && c === \"'\")\n if (match) {\n if (tmpStr === '' && format === 2) {\n aC = i\n }\n tmpStr = tmpStr + c\n }\n if (i === len - 1 || !match && tmpStr !== '') {\n if (format !== 2) {\n wArr[wArr.length] = tmpStr\n } else {\n assoc[aC] = tmpStr\n }\n tmpStr = ''\n wC++\n }\n }\n\n if (!format) {\n return wC\n } else if (format === 1) {\n return wArr\n } else if (format === 2) {\n return assoc\n }\n\n throw new Error('You have supplied an incorrect format')\n}\n"]}
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/strcasecmp.js b/node_modules/locutus/php/strings/strcasecmp.js new file mode 100644 index 0000000..624a035 --- /dev/null +++ b/node_modules/locutus/php/strings/strcasecmp.js @@ -0,0 +1,21 @@ +'use strict'; + +module.exports = function strcasecmp(fString1, fString2) { + // discuss at: http://locutus.io/php/strcasecmp/ + // original by: Martijn Wieringa + // bugfixed by: Onno Marsman (https://twitter.com/onnomarsman) + // example 1: strcasecmp('Hello', 'hello') + // returns 1: 0 + + var string1 = (fString1 + '').toLowerCase(); + var string2 = (fString2 + '').toLowerCase(); + + if (string1 > string2) { + return 1; + } else if (string1 === string2) { + return 0; + } + + return -1; +}; +//# sourceMappingURL=strcasecmp.js.map
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/strcasecmp.js.map b/node_modules/locutus/php/strings/strcasecmp.js.map new file mode 100644 index 0000000..8d79eaa --- /dev/null +++ b/node_modules/locutus/php/strings/strcasecmp.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/php/strings/strcasecmp.js"],"names":["module","exports","strcasecmp","fString1","fString2","string1","toLowerCase","string2"],"mappings":";;AAAAA,OAAOC,OAAP,GAAiB,SAASC,UAAT,CAAqBC,QAArB,EAA+BC,QAA/B,EAAyC;AACxD;AACA;AACA;AACA;AACA;;AAEA,MAAIC,UAAU,CAACF,WAAW,EAAZ,EAAgBG,WAAhB,EAAd;AACA,MAAIC,UAAU,CAACH,WAAW,EAAZ,EAAgBE,WAAhB,EAAd;;AAEA,MAAID,UAAUE,OAAd,EAAuB;AACrB,WAAO,CAAP;AACD,GAFD,MAEO,IAAIF,YAAYE,OAAhB,EAAyB;AAC9B,WAAO,CAAP;AACD;;AAED,SAAO,CAAC,CAAR;AACD,CAjBD","file":"strcasecmp.js","sourcesContent":["module.exports = function strcasecmp (fString1, fString2) {\n // discuss at: http://locutus.io/php/strcasecmp/\n // original by: Martijn Wieringa\n // bugfixed by: Onno Marsman (https://twitter.com/onnomarsman)\n // example 1: strcasecmp('Hello', 'hello')\n // returns 1: 0\n\n var string1 = (fString1 + '').toLowerCase()\n var string2 = (fString2 + '').toLowerCase()\n\n if (string1 > string2) {\n return 1\n } else if (string1 === string2) {\n return 0\n }\n\n return -1\n}\n"]}
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/strchr.js b/node_modules/locutus/php/strings/strchr.js new file mode 100644 index 0000000..5ba1644 --- /dev/null +++ b/node_modules/locutus/php/strings/strchr.js @@ -0,0 +1,14 @@ +'use strict'; + +module.exports = function strchr(haystack, needle, bool) { + // discuss at: http://locutus.io/php/strchr/ + // original by: Philip Peterson + // example 1: strchr('Kevin van Zonneveld', 'van') + // returns 1: 'van Zonneveld' + // example 2: strchr('Kevin van Zonneveld', 'van', true) + // returns 2: 'Kevin ' + + var strstr = require('../strings/strstr'); + return strstr(haystack, needle, bool); +}; +//# sourceMappingURL=strchr.js.map
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/strchr.js.map b/node_modules/locutus/php/strings/strchr.js.map new file mode 100644 index 0000000..a8b6f65 --- /dev/null +++ b/node_modules/locutus/php/strings/strchr.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/php/strings/strchr.js"],"names":["module","exports","strchr","haystack","needle","bool","strstr","require"],"mappings":";;AAAAA,OAAOC,OAAP,GAAiB,SAASC,MAAT,CAAiBC,QAAjB,EAA2BC,MAA3B,EAAmCC,IAAnC,EAAyC;AACxD;AACA;AACA;AACA;AACA;AACA;;AAEA,MAAIC,SAASC,QAAQ,mBAAR,CAAb;AACA,SAAOD,OAAOH,QAAP,EAAiBC,MAAjB,EAAyBC,IAAzB,CAAP;AACD,CAVD","file":"strchr.js","sourcesContent":["module.exports = function strchr (haystack, needle, bool) {\n // discuss at: http://locutus.io/php/strchr/\n // original by: Philip Peterson\n // example 1: strchr('Kevin van Zonneveld', 'van')\n // returns 1: 'van Zonneveld'\n // example 2: strchr('Kevin van Zonneveld', 'van', true)\n // returns 2: 'Kevin '\n\n var strstr = require('../strings/strstr')\n return strstr(haystack, needle, bool)\n}\n"]}
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/strcmp.js b/node_modules/locutus/php/strings/strcmp.js new file mode 100644 index 0000000..1d58211 --- /dev/null +++ b/node_modules/locutus/php/strings/strcmp.js @@ -0,0 +1,16 @@ +"use strict"; + +module.exports = function strcmp(str1, str2) { + // discuss at: http://locutus.io/php/strcmp/ + // original by: Waldo Malqui Silva (http://waldo.malqui.info) + // input by: Steve Hilder + // improved by: Kevin van Zonneveld (http://kvz.io) + // revised by: gorthaur + // example 1: strcmp( 'waldo', 'owald' ) + // returns 1: 1 + // example 2: strcmp( 'owald', 'waldo' ) + // returns 2: -1 + + return str1 === str2 ? 0 : str1 > str2 ? 1 : -1; +}; +//# sourceMappingURL=strcmp.js.map
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/strcmp.js.map b/node_modules/locutus/php/strings/strcmp.js.map new file mode 100644 index 0000000..f767ffd --- /dev/null +++ b/node_modules/locutus/php/strings/strcmp.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/php/strings/strcmp.js"],"names":["module","exports","strcmp","str1","str2"],"mappings":";;AAAAA,OAAOC,OAAP,GAAiB,SAASC,MAAT,CAAiBC,IAAjB,EAAuBC,IAAvB,EAA6B;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASD,SAASC,IAAV,GAAkB,CAAlB,GAAwBD,OAAOC,IAAR,GAAgB,CAAhB,GAAoB,CAAC,CAApD;AACD,CAZD","file":"strcmp.js","sourcesContent":["module.exports = function strcmp (str1, str2) {\n // discuss at: http://locutus.io/php/strcmp/\n // original by: Waldo Malqui Silva (http://waldo.malqui.info)\n // input by: Steve Hilder\n // improved by: Kevin van Zonneveld (http://kvz.io)\n // revised by: gorthaur\n // example 1: strcmp( 'waldo', 'owald' )\n // returns 1: 1\n // example 2: strcmp( 'owald', 'waldo' )\n // returns 2: -1\n\n return ((str1 === str2) ? 0 : ((str1 > str2) ? 1 : -1))\n}\n"]}
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/strcoll.js b/node_modules/locutus/php/strings/strcoll.js new file mode 100644 index 0000000..f175527 --- /dev/null +++ b/node_modules/locutus/php/strings/strcoll.js @@ -0,0 +1,23 @@ +'use strict'; + +module.exports = function strcoll(str1, str2) { + // discuss at: http://locutus.io/php/strcoll/ + // original by: Brett Zamir (http://brett-zamir.me) + // improved by: Brett Zamir (http://brett-zamir.me) + // example 1: strcoll('a', 'b') + // returns 1: -1 + + var setlocale = require('../strings/setlocale'); + + var $global = typeof window !== 'undefined' ? window : global; + $global.$locutus = $global.$locutus || {}; + var $locutus = $global.$locutus; + $locutus.php = $locutus.php || {}; + + setlocale('LC_ALL', 0); // ensure setup of localization variables takes place + + var cmp = $locutus.php.locales[$locutus.php.localeCategories.LC_COLLATE].LC_COLLATE; + + return cmp(str1, str2); +}; +//# sourceMappingURL=strcoll.js.map
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/strcoll.js.map b/node_modules/locutus/php/strings/strcoll.js.map new file mode 100644 index 0000000..5ea9929 --- /dev/null +++ b/node_modules/locutus/php/strings/strcoll.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/php/strings/strcoll.js"],"names":["module","exports","strcoll","str1","str2","setlocale","require","$global","window","global","$locutus","php","cmp","locales","localeCategories","LC_COLLATE"],"mappings":";;AAAAA,OAAOC,OAAP,GAAiB,SAASC,OAAT,CAAkBC,IAAlB,EAAwBC,IAAxB,EAA8B;AAC7C;AACA;AACA;AACA;AACA;;AAEA,MAAIC,YAAYC,QAAQ,sBAAR,CAAhB;;AAEA,MAAIC,UAAW,OAAOC,MAAP,KAAkB,WAAlB,GAAgCA,MAAhC,GAAyCC,MAAxD;AACAF,UAAQG,QAAR,GAAmBH,QAAQG,QAAR,IAAoB,EAAvC;AACA,MAAIA,WAAWH,QAAQG,QAAvB;AACAA,WAASC,GAAT,GAAeD,SAASC,GAAT,IAAgB,EAA/B;;AAEAN,YAAU,QAAV,EAAoB,CAApB,EAd6C,CActB;;AAEvB,MAAIO,MAAMF,SAASC,GAAT,CAAaE,OAAb,CAAqBH,SAASC,GAAT,CAAaG,gBAAb,CAA8BC,UAAnD,EAA+DA,UAAzE;;AAEA,SAAOH,IAAIT,IAAJ,EAAUC,IAAV,CAAP;AACD,CAnBD","file":"strcoll.js","sourcesContent":["module.exports = function strcoll (str1, str2) {\n // discuss at: http://locutus.io/php/strcoll/\n // original by: Brett Zamir (http://brett-zamir.me)\n // improved by: Brett Zamir (http://brett-zamir.me)\n // example 1: strcoll('a', 'b')\n // returns 1: -1\n\n var setlocale = require('../strings/setlocale')\n\n var $global = (typeof window !== 'undefined' ? window : global)\n $global.$locutus = $global.$locutus || {}\n var $locutus = $global.$locutus\n $locutus.php = $locutus.php || {}\n\n setlocale('LC_ALL', 0) // ensure setup of localization variables takes place\n\n var cmp = $locutus.php.locales[$locutus.php.localeCategories.LC_COLLATE].LC_COLLATE\n\n return cmp(str1, str2)\n}\n"]}
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/strcspn.js b/node_modules/locutus/php/strings/strcspn.js new file mode 100644 index 0000000..5587348 --- /dev/null +++ b/node_modules/locutus/php/strings/strcspn.js @@ -0,0 +1,30 @@ +'use strict'; + +module.exports = function strcspn(str, mask, start, length) { + // discuss at: http://locutus.io/php/strcspn/ + // original by: Brett Zamir (http://brett-zamir.me) + // revised by: Theriault + // example 1: strcspn('abcdefg123', '1234567890') + // returns 1: 7 + // example 2: strcspn('123abc', '1234567890') + // returns 2: 0 + // example 3: strcspn('abcdefg123', '1234567890', 1) + // returns 3: 6 + // example 4: strcspn('abcdefg123', '1234567890', -6, -5) + // returns 4: 1 + + start = start || 0; + length = typeof length === 'undefined' ? str.length : length || 0; + if (start < 0) start = str.length + start; + if (length < 0) length = str.length - start + length; + if (start < 0 || start >= str.length || length <= 0 || e >= str.length) return 0; + var e = Math.min(str.length, start + length); + for (var i = start, lgth = 0; i < e; i++) { + if (mask.indexOf(str.charAt(i)) !== -1) { + break; + } + ++lgth; + } + return lgth; +}; +//# sourceMappingURL=strcspn.js.map
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/strcspn.js.map b/node_modules/locutus/php/strings/strcspn.js.map new file mode 100644 index 0000000..352182d --- /dev/null +++ b/node_modules/locutus/php/strings/strcspn.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/php/strings/strcspn.js"],"names":["module","exports","strcspn","str","mask","start","length","e","Math","min","i","lgth","indexOf","charAt"],"mappings":";;AAAAA,OAAOC,OAAP,GAAiB,SAASC,OAAT,CAAkBC,GAAlB,EAAuBC,IAAvB,EAA6BC,KAA7B,EAAoCC,MAApC,EAA4C;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEAD,UAAQA,SAAS,CAAjB;AACAC,WAAS,OAAOA,MAAP,KAAkB,WAAlB,GAAgCH,IAAIG,MAApC,GAA8CA,UAAU,CAAjE;AACA,MAAID,QAAQ,CAAZ,EAAeA,QAAQF,IAAIG,MAAJ,GAAaD,KAArB;AACf,MAAIC,SAAS,CAAb,EAAgBA,SAASH,IAAIG,MAAJ,GAAaD,KAAb,GAAqBC,MAA9B;AAChB,MAAID,QAAQ,CAAR,IAAaA,SAASF,IAAIG,MAA1B,IAAoCA,UAAU,CAA9C,IAAmDC,KAAKJ,IAAIG,MAAhE,EAAwE,OAAO,CAAP;AACxE,MAAIC,IAAIC,KAAKC,GAAL,CAASN,IAAIG,MAAb,EAAqBD,QAAQC,MAA7B,CAAR;AACA,OAAK,IAAII,IAAIL,KAAR,EAAeM,OAAO,CAA3B,EAA8BD,IAAIH,CAAlC,EAAqCG,GAArC,EAA0C;AACxC,QAAIN,KAAKQ,OAAL,CAAaT,IAAIU,MAAJ,CAAWH,CAAX,CAAb,MAAgC,CAAC,CAArC,EAAwC;AACtC;AACD;AACD,MAAEC,IAAF;AACD;AACD,SAAOA,IAAP;AACD,CA1BD","file":"strcspn.js","sourcesContent":["module.exports = function strcspn (str, mask, start, length) {\n // discuss at: http://locutus.io/php/strcspn/\n // original by: Brett Zamir (http://brett-zamir.me)\n // revised by: Theriault\n // example 1: strcspn('abcdefg123', '1234567890')\n // returns 1: 7\n // example 2: strcspn('123abc', '1234567890')\n // returns 2: 0\n // example 3: strcspn('abcdefg123', '1234567890', 1)\n // returns 3: 6\n // example 4: strcspn('abcdefg123', '1234567890', -6, -5)\n // returns 4: 1\n\n start = start || 0\n length = typeof length === 'undefined' ? str.length : (length || 0)\n if (start < 0) start = str.length + start\n if (length < 0) length = str.length - start + length\n if (start < 0 || start >= str.length || length <= 0 || e >= str.length) return 0\n var e = Math.min(str.length, start + length)\n for (var i = start, lgth = 0; i < e; i++) {\n if (mask.indexOf(str.charAt(i)) !== -1) {\n break\n }\n ++lgth\n }\n return lgth\n}\n"]}
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/strip_tags.js b/node_modules/locutus/php/strings/strip_tags.js new file mode 100644 index 0000000..cc7b22d --- /dev/null +++ b/node_modules/locutus/php/strings/strip_tags.js @@ -0,0 +1,66 @@ +'use strict'; + +module.exports = function strip_tags(input, allowed) { + // eslint-disable-line camelcase + // discuss at: http://locutus.io/php/strip_tags/ + // original by: Kevin van Zonneveld (http://kvz.io) + // improved by: Luke Godfrey + // improved by: Kevin van Zonneveld (http://kvz.io) + // input by: Pul + // input by: Alex + // input by: Marc Palau + // input by: Brett Zamir (http://brett-zamir.me) + // input by: Bobby Drake + // input by: Evertjan Garretsen + // bugfixed by: Kevin van Zonneveld (http://kvz.io) + // bugfixed by: Onno Marsman (https://twitter.com/onnomarsman) + // bugfixed by: Kevin van Zonneveld (http://kvz.io) + // bugfixed by: Kevin van Zonneveld (http://kvz.io) + // bugfixed by: Eric Nagel + // bugfixed by: Kevin van Zonneveld (http://kvz.io) + // bugfixed by: Tomasz Wesolowski + // bugfixed by: Tymon Sturgeon (https://scryptonite.com) + // bugfixed by: Tim de Koning (https://www.kingsquare.nl) + // revised by: Rafał Kukawski (http://blog.kukawski.pl) + // example 1: strip_tags('<p>Kevin</p> <br /><b>van</b> <i>Zonneveld</i>', '<i><b>') + // returns 1: 'Kevin <b>van</b> <i>Zonneveld</i>' + // example 2: strip_tags('<p>Kevin <img src="someimage.png" onmouseover="someFunction()">van <i>Zonneveld</i></p>', '<p>') + // returns 2: '<p>Kevin van Zonneveld</p>' + // example 3: strip_tags("<a href='http://kvz.io'>Kevin van Zonneveld</a>", "<a>") + // returns 3: "<a href='http://kvz.io'>Kevin van Zonneveld</a>" + // example 4: strip_tags('1 < 5 5 > 1') + // returns 4: '1 < 5 5 > 1' + // example 5: strip_tags('1 <br/> 1') + // returns 5: '1 1' + // example 6: strip_tags('1 <br/> 1', '<br>') + // returns 6: '1 <br/> 1' + // example 7: strip_tags('1 <br/> 1', '<br><br/>') + // returns 7: '1 <br/> 1' + // example 8: strip_tags('<i>hello</i> <<foo>script>world<</foo>/script>') + // returns 8: 'hello world' + // example 9: strip_tags(4) + // returns 9: '4' + + var _phpCastString = require('../_helpers/_phpCastString'); + + // making sure the allowed arg is a string containing only tags in lowercase (<a><b><c>) + allowed = (((allowed || '') + '').toLowerCase().match(/<[a-z][a-z0-9]*>/g) || []).join(''); + + var tags = /<\/?([a-z][a-z0-9]*)\b[^>]*>/gi; + var commentsAndPhpTags = /<!--[\s\S]*?-->|<\?(?:php)?[\s\S]*?\?>/gi; + + var after = _phpCastString(input); + // recursively remove tags to ensure that the returned string doesn't contain forbidden tags after previous passes (e.g. '<<bait/>switch/>') + while (true) { + var before = after; + after = before.replace(commentsAndPhpTags, '').replace(tags, function ($0, $1) { + return allowed.indexOf('<' + $1.toLowerCase() + '>') > -1 ? $0 : ''; + }); + + // return once no more tags are removed + if (before === after) { + return after; + } + } +}; +//# sourceMappingURL=strip_tags.js.map
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/strip_tags.js.map b/node_modules/locutus/php/strings/strip_tags.js.map new file mode 100644 index 0000000..834fe58 --- /dev/null +++ b/node_modules/locutus/php/strings/strip_tags.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/php/strings/strip_tags.js"],"names":["module","exports","strip_tags","input","allowed","_phpCastString","require","toLowerCase","match","join","tags","commentsAndPhpTags","after","before","replace","$0","$1","indexOf"],"mappings":";;AAAAA,OAAOC,OAAP,GAAiB,SAASC,UAAT,CAAqBC,KAArB,EAA4BC,OAA5B,EAAqC;AAAE;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,MAAIC,iBAAiBC,QAAQ,4BAAR,CAArB;;AAEA;AACAF,YAAU,CAAC,CAAC,CAACA,WAAW,EAAZ,IAAkB,EAAnB,EAAuBG,WAAvB,GAAqCC,KAArC,CAA2C,mBAA3C,KAAmE,EAApE,EAAwEC,IAAxE,CAA6E,EAA7E,CAAV;;AAEA,MAAIC,OAAO,gCAAX;AACA,MAAIC,qBAAqB,0CAAzB;;AAEA,MAAIC,QAAQP,eAAeF,KAAf,CAAZ;AACA;AACA,SAAO,IAAP,EAAa;AACX,QAAIU,SAASD,KAAb;AACAA,YAAQC,OAAOC,OAAP,CAAeH,kBAAf,EAAmC,EAAnC,EAAuCG,OAAvC,CAA+CJ,IAA/C,EAAqD,UAAUK,EAAV,EAAcC,EAAd,EAAkB;AAC7E,aAAOZ,QAAQa,OAAR,CAAgB,MAAMD,GAAGT,WAAH,EAAN,GAAyB,GAAzC,IAAgD,CAAC,CAAjD,GAAqDQ,EAArD,GAA0D,EAAjE;AACD,KAFO,CAAR;;AAIA;AACA,QAAIF,WAAWD,KAAf,EAAsB;AACpB,aAAOA,KAAP;AACD;AACF;AACF,CA7DD","file":"strip_tags.js","sourcesContent":["module.exports = function strip_tags (input, allowed) { // eslint-disable-line camelcase\n // discuss at: http://locutus.io/php/strip_tags/\n // original by: Kevin van Zonneveld (http://kvz.io)\n // improved by: Luke Godfrey\n // improved by: Kevin van Zonneveld (http://kvz.io)\n // input by: Pul\n // input by: Alex\n // input by: Marc Palau\n // input by: Brett Zamir (http://brett-zamir.me)\n // input by: Bobby Drake\n // input by: Evertjan Garretsen\n // bugfixed by: Kevin van Zonneveld (http://kvz.io)\n // bugfixed by: Onno Marsman (https://twitter.com/onnomarsman)\n // bugfixed by: Kevin van Zonneveld (http://kvz.io)\n // bugfixed by: Kevin van Zonneveld (http://kvz.io)\n // bugfixed by: Eric Nagel\n // bugfixed by: Kevin van Zonneveld (http://kvz.io)\n // bugfixed by: Tomasz Wesolowski\n // bugfixed by: Tymon Sturgeon (https://scryptonite.com)\n // bugfixed by: Tim de Koning (https://www.kingsquare.nl)\n // revised by: Rafał Kukawski (http://blog.kukawski.pl)\n // example 1: strip_tags('<p>Kevin</p> <br /><b>van</b> <i>Zonneveld</i>', '<i><b>')\n // returns 1: 'Kevin <b>van</b> <i>Zonneveld</i>'\n // example 2: strip_tags('<p>Kevin <img src=\"someimage.png\" onmouseover=\"someFunction()\">van <i>Zonneveld</i></p>', '<p>')\n // returns 2: '<p>Kevin van Zonneveld</p>'\n // example 3: strip_tags(\"<a href='http://kvz.io'>Kevin van Zonneveld</a>\", \"<a>\")\n // returns 3: \"<a href='http://kvz.io'>Kevin van Zonneveld</a>\"\n // example 4: strip_tags('1 < 5 5 > 1')\n // returns 4: '1 < 5 5 > 1'\n // example 5: strip_tags('1 <br/> 1')\n // returns 5: '1 1'\n // example 6: strip_tags('1 <br/> 1', '<br>')\n // returns 6: '1 <br/> 1'\n // example 7: strip_tags('1 <br/> 1', '<br><br/>')\n // returns 7: '1 <br/> 1'\n // example 8: strip_tags('<i>hello</i> <<foo>script>world<</foo>/script>')\n // returns 8: 'hello world'\n // example 9: strip_tags(4)\n // returns 9: '4'\n\n var _phpCastString = require('../_helpers/_phpCastString')\n\n // making sure the allowed arg is a string containing only tags in lowercase (<a><b><c>)\n allowed = (((allowed || '') + '').toLowerCase().match(/<[a-z][a-z0-9]*>/g) || []).join('')\n\n var tags = /<\\/?([a-z][a-z0-9]*)\\b[^>]*>/gi\n var commentsAndPhpTags = /<!--[\\s\\S]*?-->|<\\?(?:php)?[\\s\\S]*?\\?>/gi\n\n var after = _phpCastString(input)\n // recursively remove tags to ensure that the returned string doesn't contain forbidden tags after previous passes (e.g. '<<bait/>switch/>')\n while (true) {\n var before = after\n after = before.replace(commentsAndPhpTags, '').replace(tags, function ($0, $1) {\n return allowed.indexOf('<' + $1.toLowerCase() + '>') > -1 ? $0 : ''\n })\n\n // return once no more tags are removed\n if (before === after) {\n return after\n }\n }\n}\n"]}
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/stripos.js b/node_modules/locutus/php/strings/stripos.js new file mode 100644 index 0000000..839350e --- /dev/null +++ b/node_modules/locutus/php/strings/stripos.js @@ -0,0 +1,20 @@ +'use strict'; + +module.exports = function stripos(fHaystack, fNeedle, fOffset) { + // discuss at: http://locutus.io/php/stripos/ + // original by: Martijn Wieringa + // revised by: Onno Marsman (https://twitter.com/onnomarsman) + // example 1: stripos('ABC', 'a') + // returns 1: 0 + + var haystack = (fHaystack + '').toLowerCase(); + var needle = (fNeedle + '').toLowerCase(); + var index = 0; + + if ((index = haystack.indexOf(needle, fOffset)) !== -1) { + return index; + } + + return false; +}; +//# sourceMappingURL=stripos.js.map
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/stripos.js.map b/node_modules/locutus/php/strings/stripos.js.map new file mode 100644 index 0000000..b254e0d --- /dev/null +++ b/node_modules/locutus/php/strings/stripos.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/php/strings/stripos.js"],"names":["module","exports","stripos","fHaystack","fNeedle","fOffset","haystack","toLowerCase","needle","index","indexOf"],"mappings":";;AAAAA,OAAOC,OAAP,GAAiB,SAASC,OAAT,CAAkBC,SAAlB,EAA6BC,OAA7B,EAAsCC,OAAtC,EAA+C;AAC9D;AACA;AACA;AACA;AACA;;AAEA,MAAIC,WAAW,CAACH,YAAY,EAAb,EAAiBI,WAAjB,EAAf;AACA,MAAIC,SAAS,CAACJ,UAAU,EAAX,EAAeG,WAAf,EAAb;AACA,MAAIE,QAAQ,CAAZ;;AAEA,MAAI,CAACA,QAAQH,SAASI,OAAT,CAAiBF,MAAjB,EAAyBH,OAAzB,CAAT,MAAgD,CAAC,CAArD,EAAwD;AACtD,WAAOI,KAAP;AACD;;AAED,SAAO,KAAP;AACD,CAhBD","file":"stripos.js","sourcesContent":["module.exports = function stripos (fHaystack, fNeedle, fOffset) {\n // discuss at: http://locutus.io/php/stripos/\n // original by: Martijn Wieringa\n // revised by: Onno Marsman (https://twitter.com/onnomarsman)\n // example 1: stripos('ABC', 'a')\n // returns 1: 0\n\n var haystack = (fHaystack + '').toLowerCase()\n var needle = (fNeedle + '').toLowerCase()\n var index = 0\n\n if ((index = haystack.indexOf(needle, fOffset)) !== -1) {\n return index\n }\n\n return false\n}\n"]}
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/stripslashes.js b/node_modules/locutus/php/strings/stripslashes.js new file mode 100644 index 0000000..ca88849 --- /dev/null +++ b/node_modules/locutus/php/strings/stripslashes.js @@ -0,0 +1,33 @@ +'use strict'; + +module.exports = function stripslashes(str) { + // discuss at: http://locutus.io/php/stripslashes/ + // original by: Kevin van Zonneveld (http://kvz.io) + // improved by: Ates Goral (http://magnetiq.com) + // improved by: marrtins + // improved by: rezna + // fixed by: Mick@el + // bugfixed by: Onno Marsman (https://twitter.com/onnomarsman) + // bugfixed by: Brett Zamir (http://brett-zamir.me) + // input by: Rick Waldron + // input by: Brant Messenger (http://www.brantmessenger.com/) + // reimplemented by: Brett Zamir (http://brett-zamir.me) + // example 1: stripslashes('Kevin\'s code') + // returns 1: "Kevin's code" + // example 2: stripslashes('Kevin\\\'s code') + // returns 2: "Kevin\'s code" + + return (str + '').replace(/\\(.?)/g, function (s, n1) { + switch (n1) { + case '\\': + return '\\'; + case '0': + return '\0'; + case '': + return ''; + default: + return n1; + } + }); +}; +//# sourceMappingURL=stripslashes.js.map
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/stripslashes.js.map b/node_modules/locutus/php/strings/stripslashes.js.map new file mode 100644 index 0000000..baaf08b --- /dev/null +++ b/node_modules/locutus/php/strings/stripslashes.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/php/strings/stripslashes.js"],"names":["module","exports","stripslashes","str","replace","s","n1"],"mappings":";;AAAAA,OAAOC,OAAP,GAAiB,SAASC,YAAT,CAAuBC,GAAvB,EAA4B;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAAO,CAACA,MAAM,EAAP,EACJC,OADI,CACI,SADJ,EACe,UAAUC,CAAV,EAAaC,EAAb,EAAiB;AACnC,YAAQA,EAAR;AACE,WAAK,IAAL;AACE,eAAO,IAAP;AACF,WAAK,GAAL;AACE,eAAO,IAAP;AACF,WAAK,EAAL;AACE,eAAO,EAAP;AACF;AACE,eAAOA,EAAP;AARJ;AAUD,GAZI,CAAP;AAaD,CA9BD","file":"stripslashes.js","sourcesContent":["module.exports = function stripslashes (str) {\n // discuss at: http://locutus.io/php/stripslashes/\n // original by: Kevin van Zonneveld (http://kvz.io)\n // improved by: Ates Goral (http://magnetiq.com)\n // improved by: marrtins\n // improved by: rezna\n // fixed by: Mick@el\n // bugfixed by: Onno Marsman (https://twitter.com/onnomarsman)\n // bugfixed by: Brett Zamir (http://brett-zamir.me)\n // input by: Rick Waldron\n // input by: Brant Messenger (http://www.brantmessenger.com/)\n // reimplemented by: Brett Zamir (http://brett-zamir.me)\n // example 1: stripslashes('Kevin\\'s code')\n // returns 1: \"Kevin's code\"\n // example 2: stripslashes('Kevin\\\\\\'s code')\n // returns 2: \"Kevin\\'s code\"\n\n return (str + '')\n .replace(/\\\\(.?)/g, function (s, n1) {\n switch (n1) {\n case '\\\\':\n return '\\\\'\n case '0':\n return '\\u0000'\n case '':\n return ''\n default:\n return n1\n }\n })\n}\n"]}
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/stristr.js b/node_modules/locutus/php/strings/stristr.js new file mode 100644 index 0000000..26e3704 --- /dev/null +++ b/node_modules/locutus/php/strings/stristr.js @@ -0,0 +1,26 @@ +'use strict'; + +module.exports = function stristr(haystack, needle, bool) { + // discuss at: http://locutus.io/php/stristr/ + // original by: Kevin van Zonneveld (http://kvz.io) + // bugfixed by: Onno Marsman (https://twitter.com/onnomarsman) + // example 1: stristr('Kevin van Zonneveld', 'Van') + // returns 1: 'van Zonneveld' + // example 2: stristr('Kevin van Zonneveld', 'VAN', true) + // returns 2: 'Kevin ' + + var pos = 0; + + haystack += ''; + pos = haystack.toLowerCase().indexOf((needle + '').toLowerCase()); + if (pos === -1) { + return false; + } else { + if (bool) { + return haystack.substr(0, pos); + } else { + return haystack.slice(pos); + } + } +}; +//# sourceMappingURL=stristr.js.map
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/stristr.js.map b/node_modules/locutus/php/strings/stristr.js.map new file mode 100644 index 0000000..3231c61 --- /dev/null +++ b/node_modules/locutus/php/strings/stristr.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/php/strings/stristr.js"],"names":["module","exports","stristr","haystack","needle","bool","pos","toLowerCase","indexOf","substr","slice"],"mappings":";;AAAAA,OAAOC,OAAP,GAAiB,SAASC,OAAT,CAAkBC,QAAlB,EAA4BC,MAA5B,EAAoCC,IAApC,EAA0C;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,MAAIC,MAAM,CAAV;;AAEAH,cAAY,EAAZ;AACAG,QAAMH,SAASI,WAAT,GACHC,OADG,CACK,CAACJ,SAAS,EAAV,EACNG,WADM,EADL,CAAN;AAGA,MAAID,QAAQ,CAAC,CAAb,EAAgB;AACd,WAAO,KAAP;AACD,GAFD,MAEO;AACL,QAAID,IAAJ,EAAU;AACR,aAAOF,SAASM,MAAT,CAAgB,CAAhB,EAAmBH,GAAnB,CAAP;AACD,KAFD,MAEO;AACL,aAAOH,SAASO,KAAT,CAAeJ,GAAf,CAAP;AACD;AACF;AACF,CAxBD","file":"stristr.js","sourcesContent":["module.exports = function stristr (haystack, needle, bool) {\n // discuss at: http://locutus.io/php/stristr/\n // original by: Kevin van Zonneveld (http://kvz.io)\n // bugfixed by: Onno Marsman (https://twitter.com/onnomarsman)\n // example 1: stristr('Kevin van Zonneveld', 'Van')\n // returns 1: 'van Zonneveld'\n // example 2: stristr('Kevin van Zonneveld', 'VAN', true)\n // returns 2: 'Kevin '\n\n var pos = 0\n\n haystack += ''\n pos = haystack.toLowerCase()\n .indexOf((needle + '')\n .toLowerCase())\n if (pos === -1) {\n return false\n } else {\n if (bool) {\n return haystack.substr(0, pos)\n } else {\n return haystack.slice(pos)\n }\n }\n}\n"]}
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/strlen.js b/node_modules/locutus/php/strings/strlen.js new file mode 100644 index 0000000..7c664d2 --- /dev/null +++ b/node_modules/locutus/php/strings/strlen.js @@ -0,0 +1,76 @@ +'use strict'; + +module.exports = function strlen(string) { + // discuss at: http://locutus.io/php/strlen/ + // original by: Kevin van Zonneveld (http://kvz.io) + // improved by: Sakimori + // improved by: Kevin van Zonneveld (http://kvz.io) + // input by: Kirk Strobeck + // bugfixed by: Onno Marsman (https://twitter.com/onnomarsman) + // revised by: Brett Zamir (http://brett-zamir.me) + // note 1: May look like overkill, but in order to be truly faithful to handling all Unicode + // note 1: characters and to this function in PHP which does not count the number of bytes + // note 1: but counts the number of characters, something like this is really necessary. + // example 1: strlen('Kevin van Zonneveld') + // returns 1: 19 + // example 2: ini_set('unicode.semantics', 'on') + // example 2: strlen('A\ud87e\udc04Z') + // returns 2: 3 + + var str = string + ''; + + var iniVal = (typeof require !== 'undefined' ? require('../info/ini_get')('unicode.semantics') : undefined) || 'off'; + if (iniVal === 'off') { + return str.length; + } + + var i = 0; + var lgth = 0; + + var getWholeChar = function getWholeChar(str, i) { + var code = str.charCodeAt(i); + var next = ''; + var prev = ''; + if (code >= 0xD800 && code <= 0xDBFF) { + // High surrogate (could change last hex to 0xDB7F to + // treat high private surrogates as single characters) + if (str.length <= i + 1) { + throw new Error('High surrogate without following low surrogate'); + } + next = str.charCodeAt(i + 1); + if (next < 0xDC00 || next > 0xDFFF) { + throw new Error('High surrogate without following low surrogate'); + } + return str.charAt(i) + str.charAt(i + 1); + } else if (code >= 0xDC00 && code <= 0xDFFF) { + // Low surrogate + if (i === 0) { + throw new Error('Low surrogate without preceding high surrogate'); + } + prev = str.charCodeAt(i - 1); + if (prev < 0xD800 || prev > 0xDBFF) { + // (could change last hex to 0xDB7F to treat high private surrogates + // as single characters) + throw new Error('Low surrogate without preceding high surrogate'); + } + // We can pass over low surrogates now as the second + // component in a pair which we have already processed + return false; + } + return str.charAt(i); + }; + + for (i = 0, lgth = 0; i < str.length; i++) { + if (getWholeChar(str, i) === false) { + continue; + } + // Adapt this line at the top of any loop, passing in the whole string and + // the current iteration and returning a variable to represent the individual character; + // purpose is to treat the first part of a surrogate pair as the whole character and then + // ignore the second part + lgth++; + } + + return lgth; +}; +//# sourceMappingURL=strlen.js.map
\ No newline at end of file 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,C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C,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 diff --git a/node_modules/locutus/php/strings/strnatcasecmp.js b/node_modules/locutus/php/strings/strnatcasecmp.js new file mode 100644 index 0000000..5c7437a --- /dev/null +++ b/node_modules/locutus/php/strings/strnatcasecmp.js @@ -0,0 +1,27 @@ +'use strict'; + +module.exports = function strnatcasecmp(a, b) { + // discuss at: http://locutus.io/php/strnatcasecmp/ + // original by: Martin Pool + // reimplemented by: Pierre-Luc Paour + // reimplemented by: Kristof Coomans (SCK-CEN (Belgian Nucleair Research Centre)) + // reimplemented by: Brett Zamir (http://brett-zamir.me) + // bugfixed by: Kevin van Zonneveld (http://kvz.io) + // input by: Devan Penner-Woelk + // improved by: Kevin van Zonneveld (http://kvz.io) + // reimplemented by: Rafał Kukawski + // example 1: strnatcasecmp(10, 1) + // returns 1: 1 + // example 2: strnatcasecmp('1', '10') + // returns 2: -1 + + var strnatcmp = require('../strings/strnatcmp'); + var _phpCastString = require('../_helpers/_phpCastString'); + + if (arguments.length !== 2) { + return null; + } + + return strnatcmp(_phpCastString(a).toLowerCase(), _phpCastString(b).toLowerCase()); +}; +//# sourceMappingURL=strnatcasecmp.js.map
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/strnatcasecmp.js.map b/node_modules/locutus/php/strings/strnatcasecmp.js.map new file mode 100644 index 0000000..3b42010 --- /dev/null +++ b/node_modules/locutus/php/strings/strnatcasecmp.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/php/strings/strnatcasecmp.js"],"names":["module","exports","strnatcasecmp","a","b","strnatcmp","require","_phpCastString","arguments","length","toLowerCase"],"mappings":";;AAAAA,OAAOC,OAAP,GAAiB,SAASC,aAAT,CAAwBC,CAAxB,EAA2BC,CAA3B,EAA8B;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,MAAIC,YAAYC,QAAQ,sBAAR,CAAhB;AACA,MAAIC,iBAAiBD,QAAQ,4BAAR,CAArB;;AAEA,MAAIE,UAAUC,MAAV,KAAqB,CAAzB,EAA4B;AAC1B,WAAO,IAAP;AACD;;AAED,SAAOJ,UAAUE,eAAeJ,CAAf,EAAkBO,WAAlB,EAAV,EAA2CH,eAAeH,CAAf,EAAkBM,WAAlB,EAA3C,CAAP;AACD,CAvBD","file":"strnatcasecmp.js","sourcesContent":["module.exports = function strnatcasecmp (a, b) {\n // discuss at: http://locutus.io/php/strnatcasecmp/\n // original by: Martin Pool\n // reimplemented by: Pierre-Luc Paour\n // reimplemented by: Kristof Coomans (SCK-CEN (Belgian Nucleair Research Centre))\n // reimplemented by: Brett Zamir (http://brett-zamir.me)\n // bugfixed by: Kevin van Zonneveld (http://kvz.io)\n // input by: Devan Penner-Woelk\n // improved by: Kevin van Zonneveld (http://kvz.io)\n // reimplemented by: Rafał Kukawski\n // example 1: strnatcasecmp(10, 1)\n // returns 1: 1\n // example 2: strnatcasecmp('1', '10')\n // returns 2: -1\n\n var strnatcmp = require('../strings/strnatcmp')\n var _phpCastString = require('../_helpers/_phpCastString')\n\n if (arguments.length !== 2) {\n return null\n }\n\n return strnatcmp(_phpCastString(a).toLowerCase(), _phpCastString(b).toLowerCase())\n}\n"]}
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/strnatcmp.js b/node_modules/locutus/php/strings/strnatcmp.js new file mode 100644 index 0000000..af2875c --- /dev/null +++ b/node_modules/locutus/php/strings/strnatcmp.js @@ -0,0 +1,119 @@ +'use strict'; + +module.exports = function strnatcmp(a, b) { + // discuss at: http://locutus.io/php/strnatcmp/ + // original by: Martijn Wieringa + // improved by: Michael White (http://getsprink.com) + // improved by: Jack + // bugfixed by: Onno Marsman (https://twitter.com/onnomarsman) + // reimplemented by: Rafał Kukawski + // example 1: strnatcmp('abc', 'abc') + // returns 1: 0 + // example 2: strnatcmp('a', 'b') + // returns 2: -1 + // example 3: strnatcmp('10', '1') + // returns 3: 1 + // example 4: strnatcmp('0000abc', '0abc') + // returns 4: 0 + // example 5: strnatcmp('1239', '12345') + // returns 5: -1 + // example 6: strnatcmp('t01239', 't012345') + // returns 6: 1 + // example 7: strnatcmp('0A', '5N') + // returns 7: -1 + + var _phpCastString = require('../_helpers/_phpCastString'); + + var leadingZeros = /^0+(?=\d)/; + var whitespace = /^\s/; + var digit = /^\d/; + + if (arguments.length !== 2) { + return null; + } + + a = _phpCastString(a); + b = _phpCastString(b); + + if (!a.length || !b.length) { + return a.length - b.length; + } + + var i = 0; + var j = 0; + + a = a.replace(leadingZeros, ''); + b = b.replace(leadingZeros, ''); + + while (i < a.length && j < b.length) { + // skip consecutive whitespace + while (whitespace.test(a.charAt(i))) { + i++; + }while (whitespace.test(b.charAt(j))) { + j++; + }var ac = a.charAt(i); + var bc = b.charAt(j); + var aIsDigit = digit.test(ac); + var bIsDigit = digit.test(bc); + + if (aIsDigit && bIsDigit) { + var bias = 0; + var fractional = ac === '0' || bc === '0'; + + do { + if (!aIsDigit) { + return -1; + } else if (!bIsDigit) { + return 1; + } else if (ac < bc) { + if (!bias) { + bias = -1; + } + + if (fractional) { + return -1; + } + } else if (ac > bc) { + if (!bias) { + bias = 1; + } + + if (fractional) { + return 1; + } + } + + ac = a.charAt(++i); + bc = b.charAt(++j); + + aIsDigit = digit.test(ac); + bIsDigit = digit.test(bc); + } while (aIsDigit || bIsDigit); + + if (!fractional && bias) { + return bias; + } + + continue; + } + + if (!ac || !bc) { + continue; + } else if (ac < bc) { + return -1; + } else if (ac > bc) { + return 1; + } + + i++; + j++; + } + + var iBeforeStrEnd = i < a.length; + var jBeforeStrEnd = j < b.length; + + // Check which string ended first + // return -1 if a, 1 if b, 0 otherwise + return (iBeforeStrEnd > jBeforeStrEnd) - (iBeforeStrEnd < jBeforeStrEnd); +}; +//# sourceMappingURL=strnatcmp.js.map
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/strnatcmp.js.map b/node_modules/locutus/php/strings/strnatcmp.js.map new file mode 100644 index 0000000..01c9166 --- /dev/null +++ b/node_modules/locutus/php/strings/strnatcmp.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/php/strings/strnatcmp.js"],"names":["module","exports","strnatcmp","a","b","_phpCastString","require","leadingZeros","whitespace","digit","arguments","length","i","j","replace","test","charAt","ac","bc","aIsDigit","bIsDigit","bias","fractional","iBeforeStrEnd","jBeforeStrEnd"],"mappings":";;AAAAA,OAAOC,OAAP,GAAiB,SAASC,SAAT,CAAoBC,CAApB,EAAuBC,CAAvB,EAA0B;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,MAAIC,iBAAiBC,QAAQ,4BAAR,CAArB;;AAEA,MAAIC,eAAe,WAAnB;AACA,MAAIC,aAAa,KAAjB;AACA,MAAIC,QAAQ,KAAZ;;AAEA,MAAIC,UAAUC,MAAV,KAAqB,CAAzB,EAA4B;AAC1B,WAAO,IAAP;AACD;;AAEDR,MAAIE,eAAeF,CAAf,CAAJ;AACAC,MAAIC,eAAeD,CAAf,CAAJ;;AAEA,MAAI,CAACD,EAAEQ,MAAH,IAAa,CAACP,EAAEO,MAApB,EAA4B;AAC1B,WAAOR,EAAEQ,MAAF,GAAWP,EAAEO,MAApB;AACD;;AAED,MAAIC,IAAI,CAAR;AACA,MAAIC,IAAI,CAAR;;AAEAV,MAAIA,EAAEW,OAAF,CAAUP,YAAV,EAAwB,EAAxB,CAAJ;AACAH,MAAIA,EAAEU,OAAF,CAAUP,YAAV,EAAwB,EAAxB,CAAJ;;AAEA,SAAOK,IAAIT,EAAEQ,MAAN,I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ACE,UAAD,IAAeD,IAAnB,EAAyB;AACvB,eAAOA,IAAP;AACD;;AAED;AACD;;AAED,QAAI,CAACJ,EAAD,IAAO,CAACC,EAAZ,EAAgB;AACd;AACD,KAFD,MAEO,IAAID,KAAKC,EAAT,EAAa;AAClB,aAAO,CAAC,CAAR;AACD,KAFM,MAEA,IAAID,KAAKC,EAAT,EAAa;AAClB,aAAO,CAAP;AACD;;AAEDN;AACAC;AACD;;AAED,MAAIU,gBAAgBX,IAAIT,EAAEQ,MAA1B;AACA,MAAIa,gBAAgBX,IAAIT,EAAEO,MAA1B;;AAEA;AACA;AACA,SAAO,CAACY,gBAAgBC,aAAjB,KAAmCD,gBAAgBC,aAAnD,CAAP;AACD,CAlHD","file":"strnatcmp.js","sourcesContent":["module.exports = function strnatcmp (a, b) {\n // discuss at: http://locutus.io/php/strnatcmp/\n // original by: Martijn Wieringa\n // improved by: Michael White (http://getsprink.com)\n // improved by: Jack\n // bugfixed by: Onno Marsman (https://twitter.com/onnomarsman)\n // reimplemented by: Rafał Kukawski\n // example 1: strnatcmp('abc', 'abc')\n // returns 1: 0\n // example 2: strnatcmp('a', 'b')\n // returns 2: -1\n // example 3: strnatcmp('10', '1')\n // returns 3: 1\n // example 4: strnatcmp('0000abc', '0abc')\n // returns 4: 0\n // example 5: strnatcmp('1239', '12345')\n // returns 5: -1\n // example 6: strnatcmp('t01239', 't012345')\n // returns 6: 1\n // example 7: strnatcmp('0A', '5N')\n // returns 7: -1\n\n var _phpCastString = require('../_helpers/_phpCastString')\n\n var leadingZeros = /^0+(?=\\d)/\n var whitespace = /^\\s/\n var digit = /^\\d/\n\n if (arguments.length !== 2) {\n return null\n }\n\n a = _phpCastString(a)\n b = _phpCastString(b)\n\n if (!a.length || !b.length) {\n return a.length - b.length\n }\n\n var i = 0\n var j = 0\n\n a = a.replace(leadingZeros, '')\n b = b.replace(leadingZeros, '')\n\n while (i < a.length && j < b.length) {\n // skip consecutive whitespace\n while (whitespace.test(a.charAt(i))) i++\n while (whitespace.test(b.charAt(j))) j++\n\n var ac = a.charAt(i)\n var bc = b.charAt(j)\n var aIsDigit = digit.test(ac)\n var bIsDigit = digit.test(bc)\n\n if (aIsDigit && bIsDigit) {\n var bias = 0\n var fractional = ac === '0' || bc === '0'\n\n do {\n if (!aIsDigit) {\n return -1\n } else if (!bIsDigit) {\n return 1\n } else if (ac < bc) {\n if (!bias) {\n bias = -1\n }\n\n if (fractional) {\n return -1\n }\n } else if (ac > bc) {\n if (!bias) {\n bias = 1\n }\n\n if (fractional) {\n return 1\n }\n }\n\n ac = a.charAt(++i)\n bc = b.charAt(++j)\n\n aIsDigit = digit.test(ac)\n bIsDigit = digit.test(bc)\n } while (aIsDigit || bIsDigit)\n\n if (!fractional && bias) {\n return bias\n }\n\n continue\n }\n\n if (!ac || !bc) {\n continue\n } else if (ac < bc) {\n return -1\n } else if (ac > bc) {\n return 1\n }\n\n i++\n j++\n }\n\n var iBeforeStrEnd = i < a.length\n var jBeforeStrEnd = j < b.length\n\n // Check which string ended first\n // return -1 if a, 1 if b, 0 otherwise\n return (iBeforeStrEnd > jBeforeStrEnd) - (iBeforeStrEnd < jBeforeStrEnd)\n}\n"]}
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/strncasecmp.js b/node_modules/locutus/php/strings/strncasecmp.js new file mode 100644 index 0000000..8a4b912 --- /dev/null +++ b/node_modules/locutus/php/strings/strncasecmp.js @@ -0,0 +1,55 @@ +'use strict'; + +module.exports = function strncasecmp(argStr1, argStr2, len) { + // discuss at: http://locutus.io/php/strncasecmp/ + // original by: Saulo Vallory + // input by: Nate + // bugfixed by: Onno Marsman (https://twitter.com/onnomarsman) + // note 1: Returns < 0 if str1 is less than str2 ; > 0 + // note 1: if str1 is greater than str2, and 0 if they are equal. + // example 1: strncasecmp('Price 12.9', 'Price 12.15', 2) + // returns 1: 0 + // example 2: strncasecmp('Price 12.09', 'Price 12.15', 10) + // returns 2: -1 + // example 3: strncasecmp('Price 12.90', 'Price 12.15', 30) + // returns 3: 8 + // example 4: strncasecmp('Version 12.9', 'Version 12.15', 20) + // returns 4: 8 + // example 5: strncasecmp('Version 12.15', 'Version 12.9', 20) + // returns 5: -8 + + var diff; + var i = 0; + var str1 = (argStr1 + '').toLowerCase().substr(0, len); + var str2 = (argStr2 + '').toLowerCase().substr(0, len); + + if (str1.length !== str2.length) { + if (str1.length < str2.length) { + len = str1.length; + if (str2.substr(0, str1.length) === str1) { + // return the difference of chars + return str1.length - str2.length; + } + } else { + len = str2.length; + // str1 is longer than str2 + if (str1.substr(0, str2.length) === str2) { + // return the difference of chars + return str1.length - str2.length; + } + } + } else { + // Avoids trying to get a char that does not exist + len = str1.length; + } + + for (diff = 0, i = 0; i < len; i++) { + diff = str1.charCodeAt(i) - str2.charCodeAt(i); + if (diff !== 0) { + return diff; + } + } + + return 0; +}; +//# sourceMappingURL=strncasecmp.js.map
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/strncasecmp.js.map b/node_modules/locutus/php/strings/strncasecmp.js.map new file mode 100644 index 0000000..158e143 --- /dev/null +++ b/node_modules/locutus/php/strings/strncasecmp.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/php/strings/strncasecmp.js"],"names":["module","exports","strncasecmp","argStr1","argStr2","len","diff","i","str1","toLowerCase","substr","str2","length","charCodeAt"],"mappings":";;AAAAA,OAAOC,OAAP,GAAiB,SAASC,WAAT,CAAsBC,OAAtB,EAA+BC,OAA/B,EAAwCC,GAAxC,EAA6C;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,MAAIC,IAAJ;AACA,MAAIC,IAAI,CAAR;AACA,MAAIC,OAAO,CAACL,UAAU,EAAX,EAAeM,WAAf,GAA6BC,MAA7B,CAAoC,CAApC,EAAuCL,GAAvC,CAAX;AACA,MAAIM,OAAO,CAACP,UAAU,EAAX,EAAeK,WAAf,GAA6BC,MAA7B,CAAoC,CAApC,EAAuCL,GAAvC,CAAX;;AAEA,MAAIG,KAAKI,MAAL,KAAgBD,KAAKC,MAAzB,EAAiC;AAC/B,QAAIJ,KAAKI,MAAL,GAAcD,KAAKC,MAAvB,EAA+B;AAC7BP,YAAMG,KAAKI,MAAX;AACA,UAAID,KAAKD,MAAL,CAAY,CAAZ,EAAeF,KAAKI,MAApB,MAAgCJ,IAApC,EAA0C;AACxC;AACA,eAAOA,KAAKI,MAAL,GAAcD,KAAKC,MAA1B;AACD;AACF,KAND,MAMO;AACLP,YAAMM,KAAKC,MAAX;AACA;AACA,UAAIJ,KAAKE,MAAL,CAAY,CAAZ,EAAeC,KAAKC,MAApB,MAAgCD,IAApC,EAA0C;AACxC;AACA,eAAOH,KAAKI,MAAL,GAAcD,KAAKC,MAA1B;AACD;AACF;AACF,GAfD,MAeO;AACL;AACAP,UAAMG,KAAKI,MAAX;AACD;;AAED,OAAKN,OAAO,CAAP,EAAUC,IAAI,CAAnB,EAAsBA,IAAIF,GAA1B,EAA+BE,GAA/B,EAAoC;AAClCD,WAAOE,KAAKK,UAAL,CAAgBN,CAAhB,IAAqBI,KAAKE,UAAL,CAAgBN,CAAhB,CAA5B;AACA,QAAID,SAAS,CAAb,EAAgB;AACd,aAAOA,IAAP;AACD;AACF;;AAED,SAAO,CAAP;AACD,CAnDD","file":"strncasecmp.js","sourcesContent":["module.exports = function strncasecmp (argStr1, argStr2, len) {\n // discuss at: http://locutus.io/php/strncasecmp/\n // original by: Saulo Vallory\n // input by: Nate\n // bugfixed by: Onno Marsman (https://twitter.com/onnomarsman)\n // note 1: Returns < 0 if str1 is less than str2 ; > 0\n // note 1: if str1 is greater than str2, and 0 if they are equal.\n // example 1: strncasecmp('Price 12.9', 'Price 12.15', 2)\n // returns 1: 0\n // example 2: strncasecmp('Price 12.09', 'Price 12.15', 10)\n // returns 2: -1\n // example 3: strncasecmp('Price 12.90', 'Price 12.15', 30)\n // returns 3: 8\n // example 4: strncasecmp('Version 12.9', 'Version 12.15', 20)\n // returns 4: 8\n // example 5: strncasecmp('Version 12.15', 'Version 12.9', 20)\n // returns 5: -8\n\n var diff\n var i = 0\n var str1 = (argStr1 + '').toLowerCase().substr(0, len)\n var str2 = (argStr2 + '').toLowerCase().substr(0, len)\n\n if (str1.length !== str2.length) {\n if (str1.length < str2.length) {\n len = str1.length\n if (str2.substr(0, str1.length) === str1) {\n // return the difference of chars\n return str1.length - str2.length\n }\n } else {\n len = str2.length\n // str1 is longer than str2\n if (str1.substr(0, str2.length) === str2) {\n // return the difference of chars\n return str1.length - str2.length\n }\n }\n } else {\n // Avoids trying to get a char that does not exist\n len = str1.length\n }\n\n for (diff = 0, i = 0; i < len; i++) {\n diff = str1.charCodeAt(i) - str2.charCodeAt(i)\n if (diff !== 0) {\n return diff\n }\n }\n\n return 0\n}\n"]}
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/strncmp.js b/node_modules/locutus/php/strings/strncmp.js new file mode 100644 index 0000000..7bc44ac --- /dev/null +++ b/node_modules/locutus/php/strings/strncmp.js @@ -0,0 +1,20 @@ +'use strict'; + +module.exports = function strncmp(str1, str2, lgth) { + // discuss at: http://locutus.io/php/strncmp/ + // original by: Waldo Malqui Silva (http://waldo.malqui.info) + // input by: Steve Hilder + // improved by: Kevin van Zonneveld (http://kvz.io) + // revised by: gorthaur + // reimplemented by: Brett Zamir (http://brett-zamir.me) + // example 1: strncmp('aaa', 'aab', 2) + // returns 1: 0 + // example 2: strncmp('aaa', 'aab', 3 ) + // returns 2: -1 + + var s1 = (str1 + '').substr(0, lgth); + var s2 = (str2 + '').substr(0, lgth); + + return s1 === s2 ? 0 : s1 > s2 ? 1 : -1; +}; +//# sourceMappingURL=strncmp.js.map
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/strncmp.js.map b/node_modules/locutus/php/strings/strncmp.js.map new file mode 100644 index 0000000..bda6178 --- /dev/null +++ b/node_modules/locutus/php/strings/strncmp.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/php/strings/strncmp.js"],"names":["module","exports","strncmp","str1","str2","lgth","s1","substr","s2"],"mappings":";;AAAAA,OAAOC,OAAP,GAAiB,SAASC,OAAT,CAAkBC,IAAlB,EAAwBC,IAAxB,EAA8BC,IAA9B,EAAoC;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,MAAIC,KAAK,CAACH,OAAO,EAAR,EACNI,MADM,CACC,CADD,EACIF,IADJ,CAAT;AAEA,MAAIG,KAAK,CAACJ,OAAO,EAAR,EACNG,MADM,CACC,CADD,EACIF,IADJ,CAAT;;AAGA,SAASC,OAAOE,EAAR,GAAc,CAAd,GAAoBF,KAAKE,EAAN,GAAY,CAAZ,GAAgB,CAAC,CAA5C;AACD,CAlBD","file":"strncmp.js","sourcesContent":["module.exports = function strncmp (str1, str2, lgth) {\n // discuss at: http://locutus.io/php/strncmp/\n // original by: Waldo Malqui Silva (http://waldo.malqui.info)\n // input by: Steve Hilder\n // improved by: Kevin van Zonneveld (http://kvz.io)\n // revised by: gorthaur\n // reimplemented by: Brett Zamir (http://brett-zamir.me)\n // example 1: strncmp('aaa', 'aab', 2)\n // returns 1: 0\n // example 2: strncmp('aaa', 'aab', 3 )\n // returns 2: -1\n\n var s1 = (str1 + '')\n .substr(0, lgth)\n var s2 = (str2 + '')\n .substr(0, lgth)\n\n return ((s1 === s2) ? 0 : ((s1 > s2) ? 1 : -1))\n}\n"]}
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/strpbrk.js b/node_modules/locutus/php/strings/strpbrk.js new file mode 100644 index 0000000..338b4dd --- /dev/null +++ b/node_modules/locutus/php/strings/strpbrk.js @@ -0,0 +1,19 @@ +"use strict"; + +module.exports = function strpbrk(haystack, charList) { + // discuss at: http://locutus.io/php/strpbrk/ + // original by: Alfonso Jimenez (http://www.alfonsojimenez.com) + // bugfixed by: Onno Marsman (https://twitter.com/onnomarsman) + // revised by: Christoph + // improved by: Brett Zamir (http://brett-zamir.me) + // example 1: strpbrk('This is a Simple text.', 'is') + // returns 1: 'is is a Simple text.' + + for (var i = 0, len = haystack.length; i < len; ++i) { + if (charList.indexOf(haystack.charAt(i)) >= 0) { + return haystack.slice(i); + } + } + return false; +}; +//# sourceMappingURL=strpbrk.js.map
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/strpbrk.js.map b/node_modules/locutus/php/strings/strpbrk.js.map new file mode 100644 index 0000000..13e6be0 --- /dev/null +++ b/node_modules/locutus/php/strings/strpbrk.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/php/strings/strpbrk.js"],"names":["module","exports","strpbrk","haystack","charList","i","len","length","indexOf","charAt","slice"],"mappings":";;AAAAA,OAAOC,OAAP,GAAiB,SAASC,OAAT,CAAkBC,QAAlB,EAA4BC,QAA5B,EAAsC;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAK,IAAIC,IAAI,CAAR,EAAWC,MAAMH,SAASI,MAA/B,EAAuCF,IAAIC,GAA3C,EAAgD,EAAED,CAAlD,EAAqD;AACnD,QAAID,SAASI,OAAT,CAAiBL,SAASM,MAAT,CAAgBJ,CAAhB,CAAjB,KAAwC,CAA5C,EAA+C;AAC7C,aAAOF,SAASO,KAAT,CAAeL,CAAf,CAAP;AACD;AACF;AACD,SAAO,KAAP;AACD,CAfD","file":"strpbrk.js","sourcesContent":["module.exports = function strpbrk (haystack, charList) {\n // discuss at: http://locutus.io/php/strpbrk/\n // original by: Alfonso Jimenez (http://www.alfonsojimenez.com)\n // bugfixed by: Onno Marsman (https://twitter.com/onnomarsman)\n // revised by: Christoph\n // improved by: Brett Zamir (http://brett-zamir.me)\n // example 1: strpbrk('This is a Simple text.', 'is')\n // returns 1: 'is is a Simple text.'\n\n for (var i = 0, len = haystack.length; i < len; ++i) {\n if (charList.indexOf(haystack.charAt(i)) >= 0) {\n return haystack.slice(i)\n }\n }\n return false\n}\n"]}
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/strpos.js b/node_modules/locutus/php/strings/strpos.js new file mode 100644 index 0000000..257151b --- /dev/null +++ b/node_modules/locutus/php/strings/strpos.js @@ -0,0 +1,15 @@ +'use strict'; + +module.exports = function strpos(haystack, needle, offset) { + // discuss at: http://locutus.io/php/strpos/ + // original by: Kevin van Zonneveld (http://kvz.io) + // improved by: Onno Marsman (https://twitter.com/onnomarsman) + // improved by: Brett Zamir (http://brett-zamir.me) + // bugfixed by: Daniel Esteban + // example 1: strpos('Kevin van Zonneveld', 'e', 5) + // returns 1: 14 + + var i = (haystack + '').indexOf(needle, offset || 0); + return i === -1 ? false : i; +}; +//# sourceMappingURL=strpos.js.map
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/strpos.js.map b/node_modules/locutus/php/strings/strpos.js.map new file mode 100644 index 0000000..9e84ea6 --- /dev/null +++ b/node_modules/locutus/php/strings/strpos.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/php/strings/strpos.js"],"names":["module","exports","strpos","haystack","needle","offset","i","indexOf"],"mappings":";;AAAAA,OAAOC,OAAP,GAAiB,SAASC,MAAT,CAAiBC,QAAjB,EAA2BC,MAA3B,EAAmCC,MAAnC,EAA2C;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,MAAIC,IAAI,CAACH,WAAW,EAAZ,EACLI,OADK,CACGH,MADH,EACYC,UAAU,CADtB,CAAR;AAEA,SAAOC,MAAM,CAAC,CAAP,GAAW,KAAX,GAAmBA,CAA1B;AACD,CAZD","file":"strpos.js","sourcesContent":["module.exports = function strpos (haystack, needle, offset) {\n // discuss at: http://locutus.io/php/strpos/\n // original by: Kevin van Zonneveld (http://kvz.io)\n // improved by: Onno Marsman (https://twitter.com/onnomarsman)\n // improved by: Brett Zamir (http://brett-zamir.me)\n // bugfixed by: Daniel Esteban\n // example 1: strpos('Kevin van Zonneveld', 'e', 5)\n // returns 1: 14\n\n var i = (haystack + '')\n .indexOf(needle, (offset || 0))\n return i === -1 ? false : i\n}\n"]}
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/strrchr.js b/node_modules/locutus/php/strings/strrchr.js new file mode 100644 index 0000000..1262865 --- /dev/null +++ b/node_modules/locutus/php/strings/strrchr.js @@ -0,0 +1,24 @@ +'use strict'; + +module.exports = function strrchr(haystack, needle) { + // discuss at: http://locutus.io/php/strrchr/ + // original by: Brett Zamir (http://brett-zamir.me) + // input by: Jason Wong (http://carrot.org/) + // bugfixed by: Brett Zamir (http://brett-zamir.me) + // example 1: strrchr("Line 1\nLine 2\nLine 3", 10).substr(1) + // returns 1: 'Line 3' + + var pos = 0; + + if (typeof needle !== 'string') { + needle = String.fromCharCode(parseInt(needle, 10)); + } + needle = needle.charAt(0); + pos = haystack.lastIndexOf(needle); + if (pos === -1) { + return false; + } + + return haystack.substr(pos); +}; +//# sourceMappingURL=strrchr.js.map
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/strrchr.js.map b/node_modules/locutus/php/strings/strrchr.js.map new file mode 100644 index 0000000..0814a12 --- /dev/null +++ b/node_modules/locutus/php/strings/strrchr.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/php/strings/strrchr.js"],"names":["module","exports","strrchr","haystack","needle","pos","String","fromCharCode","parseInt","charAt","lastIndexOf","substr"],"mappings":";;AAAAA,OAAOC,OAAP,GAAiB,SAASC,OAAT,CAAkBC,QAAlB,EAA4BC,MAA5B,EAAoC;AACnD;AACA;AACA;AACA;AACA;AACA;;AAEA,MAAIC,MAAM,CAAV;;AAEA,MAAI,OAAOD,MAAP,KAAkB,QAAtB,EAAgC;AAC9BA,aAASE,OAAOC,YAAP,CAAoBC,SAASJ,MAAT,EAAiB,EAAjB,CAApB,CAAT;AACD;AACDA,WAASA,OAAOK,MAAP,CAAc,CAAd,CAAT;AACAJ,QAAMF,SAASO,WAAT,CAAqBN,MAArB,CAAN;AACA,MAAIC,QAAQ,CAAC,CAAb,EAAgB;AACd,WAAO,KAAP;AACD;;AAED,SAAOF,SAASQ,MAAT,CAAgBN,GAAhB,CAAP;AACD,CApBD","file":"strrchr.js","sourcesContent":["module.exports = function strrchr (haystack, needle) {\n // discuss at: http://locutus.io/php/strrchr/\n // original by: Brett Zamir (http://brett-zamir.me)\n // input by: Jason Wong (http://carrot.org/)\n // bugfixed by: Brett Zamir (http://brett-zamir.me)\n // example 1: strrchr(\"Line 1\\nLine 2\\nLine 3\", 10).substr(1)\n // returns 1: 'Line 3'\n\n var pos = 0\n\n if (typeof needle !== 'string') {\n needle = String.fromCharCode(parseInt(needle, 10))\n }\n needle = needle.charAt(0)\n pos = haystack.lastIndexOf(needle)\n if (pos === -1) {\n return false\n }\n\n return haystack.substr(pos)\n}\n"]}
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/strrev.js b/node_modules/locutus/php/strings/strrev.js new file mode 100644 index 0000000..0091a17 --- /dev/null +++ b/node_modules/locutus/php/strings/strrev.js @@ -0,0 +1,34 @@ +'use strict'; + +module.exports = function strrev(string) { + // discuss at: http://locutus.io/php/strrev/ + // original by: Kevin van Zonneveld (http://kvz.io) + // bugfixed by: Onno Marsman (https://twitter.com/onnomarsman) + // reimplemented by: Brett Zamir (http://brett-zamir.me) + // example 1: strrev('Kevin van Zonneveld') + // returns 1: 'dlevennoZ nav niveK' + // example 2: strrev('a\u0301haB') + // returns 2: 'Baha\u0301' // combining + // example 3: strrev('A\uD87E\uDC04Z') + // returns 3: 'Z\uD87E\uDC04A' // surrogates + // test: 'skip-3' + + string = string + ''; + + // Performance will be enhanced with the next two lines of code commented + // out if you don't care about combining characters + // Keep Unicode combining characters together with the character preceding + // them and which they are modifying (as in PHP 6) + // See http://unicode.org/reports/tr44/#Property_Table (Me+Mn) + // We also add the low surrogate range at the beginning here so it will be + // maintained with its preceding high surrogate + + var chars = ['\uDC00-\uDFFF', '\u0300-\u036F', '\u0483-\u0489', '\u0591-\u05BD', '\u05BF', '\u05C1', '\u05C2', '\u05C4', '\u05C5', '\u05C7', '\u0610-\u061A', '\u064B-\u065E', '\u0670', '\u06D6-\u06DC', '\u06DE-\u06E4', '\u06E7\u06E8', '\u06EA-\u06ED', '\u0711', '\u0730-\u074A', '\u07A6-\u07B0', '\u07EB-\u07F3', '\u0901-\u0903', '\u093C', '\u093E-\u094D', '\u0951-\u0954', '\u0962', '\u0963', '\u0981-\u0983', '\u09BC', '\u09BE-\u09C4', '\u09C7', '\u09C8', '\u09CB-\u09CD', '\u09D7', '\u09E2', '\u09E3', '\u0A01-\u0A03', '\u0A3C', '\u0A3E-\u0A42', '\u0A47', '\u0A48', '\u0A4B-\u0A4D', '\u0A51', '\u0A70', '\u0A71', '\u0A75', '\u0A81-\u0A83', '\u0ABC', '\u0ABE-\u0AC5', '\u0AC7-\u0AC9', '\u0ACB-\u0ACD', '\u0AE2', '\u0AE3', '\u0B01-\u0B03', '\u0B3C', '\u0B3E-\u0B44', '\u0B47', '\u0B48', '\u0B4B-\u0B4D', '\u0B56', '\u0B57', '\u0B62', '\u0B63', '\u0B82', '\u0BBE-\u0BC2', '\u0BC6-\u0BC8', '\u0BCA-\u0BCD', '\u0BD7', '\u0C01-\u0C03', '\u0C3E-\u0C44', '\u0C46-\u0C48', '\u0C4A-\u0C4D', '\u0C55', '\u0C56', '\u0C62', '\u0C63', '\u0C82', '\u0C83', '\u0CBC', '\u0CBE-\u0CC4', '\u0CC6-\u0CC8', '\u0CCA-\u0CCD', '\u0CD5', '\u0CD6', '\u0CE2', '\u0CE3', '\u0D02', '\u0D03', '\u0D3E-\u0D44', '\u0D46-\u0D48', '\u0D4A-\u0D4D', '\u0D57', '\u0D62', '\u0D63', '\u0D82', '\u0D83', '\u0DCA', '\u0DCF-\u0DD4', '\u0DD6', '\u0DD8-\u0DDF', '\u0DF2', '\u0DF3', '\u0E31', '\u0E34-\u0E3A', '\u0E47-\u0E4E', '\u0EB1', '\u0EB4-\u0EB9', '\u0EBB', '\u0EBC', '\u0EC8-\u0ECD', '\u0F18', '\u0F19', '\u0F35', '\u0F37', '\u0F39', '\u0F3E', '\u0F3F', '\u0F71-\u0F84', '\u0F86', '\u0F87', '\u0F90-\u0F97', '\u0F99-\u0FBC', '\u0FC6', '\u102B-\u103E', '\u1056-\u1059', '\u105E-\u1060', '\u1062-\u1064', '\u1067-\u106D', '\u1071-\u1074', '\u1082-\u108D', '\u108F', '\u135F', '\u1712-\u1714', '\u1732-\u1734', '\u1752', '\u1753', '\u1772', '\u1773', '\u17B6-\u17D3', '\u17DD', '\u180B-\u180D', '\u18A9', '\u1920-\u192B', '\u1930-\u193B', '\u19B0-\u19C0', '\u19C8', '\u19C9', '\u1A17-\u1A1B', '\u1B00-\u1B04', '\u1B34-\u1B44', '\u1B6B-\u1B73', '\u1B80-\u1B82', '\u1BA1-\u1BAA', '\u1C24-\u1C37', '\u1DC0-\u1DE6', '\u1DFE', '\u1DFF', '\u20D0-\u20F0', '\u2DE0-\u2DFF', '\u302A-\u302F', '\u3099', '\u309A', '\uA66F-\uA672', '\uA67C', '\uA67D', '\uA802', '\uA806', '\uA80B', '\uA823-\uA827', '\uA880', '\uA881', '\uA8B4-\uA8C4', '\uA926-\uA92D', '\uA947-\uA953', '\uAA29-\uAA36', '\uAA43', '\uAA4C', '\uAA4D', '\uFB1E', '\uFE00-\uFE0F', '\uFE20-\uFE26']; + + var graphemeExtend = new RegExp('(.)([' + chars.join('') + ']+)', 'g'); + + // Temporarily reverse + string = string.replace(graphemeExtend, '$2$1'); + return string.split('').reverse().join(''); +}; +//# sourceMappingURL=strrev.js.map
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/strrev.js.map b/node_modules/locutus/php/strings/strrev.js.map new file mode 100644 index 0000000..8518d1e --- /dev/null +++ b/node_modules/locutus/php/strings/strrev.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/php/strings/strrev.js"],"names":["module","exports","strrev","string","chars","graphemeExtend","RegExp","join","replace","split","reverse"],"mappings":";;AAAAA,OAAOC,OAAP,GAAiB,SAASC,MAAT,CAAiBC,MAAjB,EAAyB;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEAA,WAASA,SAAS,EAAl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KV,eA5KU,EA6KV,eA7KU,EA8KV,eA9KU,EA+KV,eA/KU,EAgLV,QAhLU,EAiLV,QAjLU,EAkLV,QAlLU,EAmLV,QAnLU,EAoLV,eApLU,EAqLV,eArLU,CAAZ;;AAwLA,MAAIC,iBAAiB,IAAIC,MAAJ,CAAW,UAAUF,MAAMG,IAAN,CAAW,EAAX,CAAV,GAA2B,KAAtC,EAA6C,GAA7C,CAArB;;AAEA;AACAJ,WAASA,OAAOK,OAAP,CAAeH,cAAf,EAA+B,MAA/B,CAAT;AACA,SAAOF,OAAOM,KAAP,CAAa,EAAb,EAAiBC,OAAjB,GAA2BH,IAA3B,CAAgC,EAAhC,CAAP;AACD,CApND","file":"strrev.js","sourcesContent":["module.exports = function strrev (string) {\n // discuss at: http://locutus.io/php/strrev/\n // original by: Kevin van Zonneveld (http://kvz.io)\n // bugfixed by: Onno Marsman (https://twitter.com/onnomarsman)\n // reimplemented by: Brett Zamir (http://brett-zamir.me)\n // example 1: strrev('Kevin van Zonneveld')\n // returns 1: 'dlevennoZ nav niveK'\n // example 2: strrev('a\\u0301haB')\n // returns 2: 'Baha\\u0301' // combining\n // example 3: strrev('A\\uD87E\\uDC04Z')\n // returns 3: 'Z\\uD87E\\uDC04A' // surrogates\n // test: 'skip-3'\n\n string = string + ''\n\n // Performance will be enhanced with the next two lines of code commented\n // out if you don't care about combining characters\n // Keep Unicode combining characters together with the character preceding\n // them and which they are modifying (as in PHP 6)\n // See http://unicode.org/reports/tr44/#Property_Table (Me+Mn)\n // We also add the low surrogate range at the beginning here so it will be\n // maintained with its preceding high surrogate\n\n var chars = [\n '\\uDC00-\\uDFFF',\n '\\u0300-\\u036F',\n '\\u0483-\\u0489',\n '\\u0591-\\u05BD',\n '\\u05BF',\n '\\u05C1',\n '\\u05C2',\n '\\u05C4',\n '\\u05C5',\n '\\u05C7',\n '\\u0610-\\u061A',\n '\\u064B-\\u065E',\n '\\u0670',\n '\\u06D6-\\u06DC',\n '\\u06DE-\\u06E4',\n '\\u06E7\\u06E8',\n '\\u06EA-\\u06ED',\n '\\u0711',\n '\\u0730-\\u074A',\n '\\u07A6-\\u07B0',\n '\\u07EB-\\u07F3',\n '\\u0901-\\u0903',\n '\\u093C',\n '\\u093E-\\u094D',\n '\\u0951-\\u0954',\n '\\u0962',\n '\\u0963',\n '\\u0981-\\u0983',\n '\\u09BC',\n '\\u09BE-\\u09C4',\n '\\u09C7',\n '\\u09C8',\n '\\u09CB-\\u09CD',\n '\\u09D7',\n '\\u09E2',\n '\\u09E3',\n '\\u0A01-\\u0A03',\n '\\u0A3C',\n '\\u0A3E-\\u0A42',\n '\\u0A47',\n '\\u0A48',\n '\\u0A4B-\\u0A4D',\n '\\u0A51',\n '\\u0A70',\n '\\u0A71',\n '\\u0A75',\n '\\u0A81-\\u0A83',\n '\\u0ABC',\n '\\u0ABE-\\u0AC5',\n '\\u0AC7-\\u0AC9',\n '\\u0ACB-\\u0ACD',\n '\\u0AE2',\n '\\u0AE3',\n '\\u0B01-\\u0B03',\n '\\u0B3C',\n '\\u0B3E-\\u0B44',\n '\\u0B47',\n '\\u0B48',\n '\\u0B4B-\\u0B4D',\n '\\u0B56',\n '\\u0B57',\n '\\u0B62',\n '\\u0B63',\n '\\u0B82',\n '\\u0BBE-\\u0BC2',\n '\\u0BC6-\\u0BC8',\n '\\u0BCA-\\u0BCD',\n '\\u0BD7',\n '\\u0C01-\\u0C03',\n '\\u0C3E-\\u0C44',\n '\\u0C46-\\u0C48',\n '\\u0C4A-\\u0C4D',\n '\\u0C55',\n '\\u0C56',\n '\\u0C62',\n '\\u0C63',\n '\\u0C82',\n '\\u0C83',\n '\\u0CBC',\n '\\u0CBE-\\u0CC4',\n '\\u0CC6-\\u0CC8',\n '\\u0CCA-\\u0CCD',\n '\\u0CD5',\n '\\u0CD6',\n '\\u0CE2',\n '\\u0CE3',\n '\\u0D02',\n '\\u0D03',\n '\\u0D3E-\\u0D44',\n '\\u0D46-\\u0D48',\n '\\u0D4A-\\u0D4D',\n '\\u0D57',\n '\\u0D62',\n '\\u0D63',\n '\\u0D82',\n '\\u0D83',\n '\\u0DCA',\n '\\u0DCF-\\u0DD4',\n '\\u0DD6',\n '\\u0DD8-\\u0DDF',\n '\\u0DF2',\n '\\u0DF3',\n '\\u0E31',\n '\\u0E34-\\u0E3A',\n '\\u0E47-\\u0E4E',\n '\\u0EB1',\n '\\u0EB4-\\u0EB9',\n '\\u0EBB',\n '\\u0EBC',\n '\\u0EC8-\\u0ECD',\n '\\u0F18',\n '\\u0F19',\n '\\u0F35',\n '\\u0F37',\n '\\u0F39',\n '\\u0F3E',\n '\\u0F3F',\n '\\u0F71-\\u0F84',\n '\\u0F86',\n '\\u0F87',\n '\\u0F90-\\u0F97',\n '\\u0F99-\\u0FBC',\n '\\u0FC6',\n '\\u102B-\\u103E',\n '\\u1056-\\u1059',\n '\\u105E-\\u1060',\n '\\u1062-\\u1064',\n '\\u1067-\\u106D',\n '\\u1071-\\u1074',\n '\\u1082-\\u108D',\n '\\u108F',\n '\\u135F',\n '\\u1712-\\u1714',\n '\\u1732-\\u1734',\n '\\u1752',\n '\\u1753',\n '\\u1772',\n '\\u1773',\n '\\u17B6-\\u17D3',\n '\\u17DD',\n '\\u180B-\\u180D',\n '\\u18A9',\n '\\u1920-\\u192B',\n '\\u1930-\\u193B',\n '\\u19B0-\\u19C0',\n '\\u19C8',\n '\\u19C9',\n '\\u1A17-\\u1A1B',\n '\\u1B00-\\u1B04',\n '\\u1B34-\\u1B44',\n '\\u1B6B-\\u1B73',\n '\\u1B80-\\u1B82',\n '\\u1BA1-\\u1BAA',\n '\\u1C24-\\u1C37',\n '\\u1DC0-\\u1DE6',\n '\\u1DFE',\n '\\u1DFF',\n '\\u20D0-\\u20F0',\n '\\u2DE0-\\u2DFF',\n '\\u302A-\\u302F',\n '\\u3099',\n '\\u309A',\n '\\uA66F-\\uA672',\n '\\uA67C',\n '\\uA67D',\n '\\uA802',\n '\\uA806',\n '\\uA80B',\n '\\uA823-\\uA827',\n '\\uA880',\n '\\uA881',\n '\\uA8B4-\\uA8C4',\n '\\uA926-\\uA92D',\n '\\uA947-\\uA953',\n '\\uAA29-\\uAA36',\n '\\uAA43',\n '\\uAA4C',\n '\\uAA4D',\n '\\uFB1E',\n '\\uFE00-\\uFE0F',\n '\\uFE20-\\uFE26'\n ]\n\n var graphemeExtend = new RegExp('(.)([' + chars.join('') + ']+)', 'g')\n\n // Temporarily reverse\n string = string.replace(graphemeExtend, '$2$1')\n return string.split('').reverse().join('')\n}\n"]}
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/strripos.js b/node_modules/locutus/php/strings/strripos.js new file mode 100644 index 0000000..03f60b8 --- /dev/null +++ b/node_modules/locutus/php/strings/strripos.js @@ -0,0 +1,27 @@ +'use strict'; + +module.exports = function strripos(haystack, needle, offset) { + // discuss at: http://locutus.io/php/strripos/ + // original by: Kevin van Zonneveld (http://kvz.io) + // bugfixed by: Onno Marsman (https://twitter.com/onnomarsman) + // bugfixed by: Brett Zamir (http://brett-zamir.me) + // input by: saulius + // example 1: strripos('Kevin van Zonneveld', 'E') + // returns 1: 16 + + haystack = (haystack + '').toLowerCase(); + needle = (needle + '').toLowerCase(); + + var i = -1; + if (offset) { + i = (haystack + '').slice(offset).lastIndexOf(needle); // strrpos' offset indicates starting point of range till end, + // while lastIndexOf's optional 2nd argument indicates ending point of range from the beginning + if (i !== -1) { + i += offset; + } + } else { + i = (haystack + '').lastIndexOf(needle); + } + return i >= 0 ? i : false; +}; +//# sourceMappingURL=strripos.js.map
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/strripos.js.map b/node_modules/locutus/php/strings/strripos.js.map new file mode 100644 index 0000000..323ab73 --- /dev/null +++ b/node_modules/locutus/php/strings/strripos.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/php/strings/strripos.js"],"names":["module","exports","strripos","haystack","needle","offset","toLowerCase","i","slice","lastIndexOf"],"mappings":";;AAAAA,OAAOC,OAAP,GAAiB,SAASC,QAAT,CAAmBC,QAAnB,EAA6BC,MAA7B,EAAqCC,MAArC,EAA6C;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;;AAEAF,aAAW,CAACA,WAAW,EAAZ,EACRG,WADQ,EAAX;AAEAF,WAAS,CAACA,SAAS,EAAV,EACNE,WADM,EAAT;;AAGA,MAAIC,IAAI,CAAC,CAAT;AACA,MAAIF,MAAJ,EAAY;AACVE,QAAI,CAACJ,WAAW,EAAZ,EACDK,KADC,CACKH,MADL,EAEDI,WAFC,CAEWL,MAFX,CAAJ,CADU,CAGa;AACvB;AACA,QAAIG,MAAM,CAAC,CAAX,EAAc;AACZA,WAAKF,MAAL;AACD;AACF,GARD,MAQO;AACLE,QAAI,CAACJ,WAAW,EAAZ,EACDM,WADC,CACWL,MADX,CAAJ;AAED;AACD,SAAOG,KAAK,CAAL,GAASA,CAAT,GAAa,KAApB;AACD,CA5BD","file":"strripos.js","sourcesContent":["module.exports = function strripos (haystack, needle, offset) {\n // discuss at: http://locutus.io/php/strripos/\n // original by: Kevin van Zonneveld (http://kvz.io)\n // bugfixed by: Onno Marsman (https://twitter.com/onnomarsman)\n // bugfixed by: Brett Zamir (http://brett-zamir.me)\n // input by: saulius\n // example 1: strripos('Kevin van Zonneveld', 'E')\n // returns 1: 16\n\n haystack = (haystack + '')\n .toLowerCase()\n needle = (needle + '')\n .toLowerCase()\n\n var i = -1\n if (offset) {\n i = (haystack + '')\n .slice(offset)\n .lastIndexOf(needle) // strrpos' offset indicates starting point of range till end,\n // while lastIndexOf's optional 2nd argument indicates ending point of range from the beginning\n if (i !== -1) {\n i += offset\n }\n } else {\n i = (haystack + '')\n .lastIndexOf(needle)\n }\n return i >= 0 ? i : false\n}\n"]}
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/strrpos.js b/node_modules/locutus/php/strings/strrpos.js new file mode 100644 index 0000000..ccabd92 --- /dev/null +++ b/node_modules/locutus/php/strings/strrpos.js @@ -0,0 +1,30 @@ +'use strict'; + +module.exports = function strrpos(haystack, needle, offset) { + // discuss at: http://locutus.io/php/strrpos/ + // original by: Kevin van Zonneveld (http://kvz.io) + // bugfixed by: Onno Marsman (https://twitter.com/onnomarsman) + // bugfixed by: Brett Zamir (http://brett-zamir.me) + // input by: saulius + // example 1: strrpos('Kevin van Zonneveld', 'e') + // returns 1: 16 + // example 2: strrpos('somepage.com', '.', false) + // returns 2: 8 + // example 3: strrpos('baa', 'a', 3) + // returns 3: false + // example 4: strrpos('baa', 'a', 2) + // returns 4: 2 + + var i = -1; + if (offset) { + i = (haystack + '').slice(offset).lastIndexOf(needle); // strrpos' offset indicates starting point of range till end, + // while lastIndexOf's optional 2nd argument indicates ending point of range from the beginning + if (i !== -1) { + i += offset; + } + } else { + i = (haystack + '').lastIndexOf(needle); + } + return i >= 0 ? i : false; +}; +//# sourceMappingURL=strrpos.js.map
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/strrpos.js.map b/node_modules/locutus/php/strings/strrpos.js.map new file mode 100644 index 0000000..6e64fbe --- /dev/null +++ b/node_modules/locutus/php/strings/strrpos.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/php/strings/strrpos.js"],"names":["module","exports","strrpos","haystack","needle","offset","i","slice","lastIndexOf"],"mappings":";;AAAAA,OAAOC,OAAP,GAAiB,SAASC,OAAT,CAAkBC,QAAlB,EAA4BC,MAA5B,EAAoCC,MAApC,EAA4C;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,MAAIC,IAAI,CAAC,CAAT;AACA,MAAID,MAAJ,EAAY;AACVC,QAAI,CAACH,WAAW,EAAZ,EACDI,KADC,CACKF,MADL,EAEDG,WAFC,CAEWJ,MAFX,CAAJ,CADU,CAGa;AACvB;AACA,QAAIE,MAAM,CAAC,CAAX,EAAc;AACZA,WAAKD,MAAL;AACD;AACF,GARD,MAQO;AACLC,QAAI,CAACH,WAAW,EAAZ,EACDK,WADC,CACWJ,MADX,CAAJ;AAED;AACD,SAAOE,KAAK,CAAL,GAASA,CAAT,GAAa,KAApB;AACD,CA7BD","file":"strrpos.js","sourcesContent":["module.exports = function strrpos (haystack, needle, offset) {\n // discuss at: http://locutus.io/php/strrpos/\n // original by: Kevin van Zonneveld (http://kvz.io)\n // bugfixed by: Onno Marsman (https://twitter.com/onnomarsman)\n // bugfixed by: Brett Zamir (http://brett-zamir.me)\n // input by: saulius\n // example 1: strrpos('Kevin van Zonneveld', 'e')\n // returns 1: 16\n // example 2: strrpos('somepage.com', '.', false)\n // returns 2: 8\n // example 3: strrpos('baa', 'a', 3)\n // returns 3: false\n // example 4: strrpos('baa', 'a', 2)\n // returns 4: 2\n\n var i = -1\n if (offset) {\n i = (haystack + '')\n .slice(offset)\n .lastIndexOf(needle) // strrpos' offset indicates starting point of range till end,\n // while lastIndexOf's optional 2nd argument indicates ending point of range from the beginning\n if (i !== -1) {\n i += offset\n }\n } else {\n i = (haystack + '')\n .lastIndexOf(needle)\n }\n return i >= 0 ? i : false\n}\n"]}
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/strspn.js b/node_modules/locutus/php/strings/strspn.js new file mode 100644 index 0000000..59e52c7 --- /dev/null +++ b/node_modules/locutus/php/strings/strspn.js @@ -0,0 +1,39 @@ +"use strict"; + +module.exports = function strspn(str1, str2, start, lgth) { + // discuss at: http://locutus.io/php/strspn/ + // original by: Valentina De Rosa + // improved by: Brett Zamir (http://brett-zamir.me) + // example 1: strspn('42 is the answer, what is the question ...', '1234567890') + // returns 1: 2 + // example 2: strspn('foo', 'o', 1, 2) + // returns 2: 2 + + var found; + var stri; + var strj; + var j = 0; + var i = 0; + + start = start ? start < 0 ? str1.length + start : start : 0; + lgth = lgth ? lgth < 0 ? str1.length + lgth - start : lgth : str1.length - start; + str1 = str1.substr(start, lgth); + + for (i = 0; i < str1.length; i++) { + found = 0; + stri = str1.substring(i, i + 1); + for (j = 0; j <= str2.length; j++) { + strj = str2.substring(j, j + 1); + if (stri === strj) { + found = 1; + break; + } + } + if (found !== 1) { + return i; + } + } + + return i; +}; +//# sourceMappingURL=strspn.js.map
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/strspn.js.map b/node_modules/locutus/php/strings/strspn.js.map new file mode 100644 index 0000000..c98518a --- /dev/null +++ b/node_modules/locutus/php/strings/strspn.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/php/strings/strspn.js"],"names":["module","exports","strspn","str1","str2","start","lgth","found","stri","strj","j","i","length","substr","substring"],"mappings":";;AAAAA,OAAOC,OAAP,GAAiB,SAASC,MAAT,CAAiBC,IAAjB,EAAuBC,IAAvB,EAA6BC,KAA7B,EAAoCC,IAApC,EAA0C;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,MAAIC,KAAJ;AACA,MAAIC,IAAJ;AACA,MAAIC,IAAJ;AACA,MAAIC,IAAI,CAAR;AACA,MAAIC,IAAI,CAAR;;AAEAN,UAAQA,QAASA,QAAQ,CAAR,GAAaF,KAAKS,MAAL,GAAcP,KAA3B,GAAoCA,KAA7C,GAAsD,CAA9D;AACAC,SAAOA,OAASA,OAAO,CAAR,GAAcH,KAAKS,MAAL,GAAcN,IAAd,GAAqBD,KAAnC,GAA4CC,IAApD,GAA4DH,KAAKS,MAAL,GAAcP,KAAjF;AACAF,SAAOA,KAAKU,MAAL,CAAYR,KAAZ,EAAmBC,IAAnB,CAAP;;AAEA,OAAKK,IAAI,CAAT,EAAYA,IAAIR,KAAKS,MAArB,EAA6BD,GAA7B,EAAkC;AAChCJ,YAAQ,CAAR;AACAC,WAAOL,KAAKW,SAAL,CAAeH,CAAf,EAAkBA,IAAI,CAAtB,CAAP;AACA,SAAKD,IAAI,CAAT,EAAYA,KAAKN,KAAKQ,MAAtB,EAA8BF,GAA9B,EAAmC;AACjCD,aAAOL,KAAKU,SAAL,CAAeJ,CAAf,EAAkBA,IAAI,CAAtB,CAAP;AACA,UAAIF,SAASC,IAAb,EAAmB;AACjBF,gBAAQ,CAAR;AACA;AACD;AACF;AACD,QAAIA,UAAU,CAAd,EAAiB;AACf,aAAOI,CAAP;AACD;AACF;;AAED,SAAOA,CAAP;AACD,CAnCD","file":"strspn.js","sourcesContent":["module.exports = function strspn (str1, str2, start, lgth) {\n // discuss at: http://locutus.io/php/strspn/\n // original by: Valentina De Rosa\n // improved by: Brett Zamir (http://brett-zamir.me)\n // example 1: strspn('42 is the answer, what is the question ...', '1234567890')\n // returns 1: 2\n // example 2: strspn('foo', 'o', 1, 2)\n // returns 2: 2\n\n var found\n var stri\n var strj\n var j = 0\n var i = 0\n\n start = start ? (start < 0 ? (str1.length + start) : start) : 0\n lgth = lgth ? ((lgth < 0) ? (str1.length + lgth - start) : lgth) : str1.length - start\n str1 = str1.substr(start, lgth)\n\n for (i = 0; i < str1.length; i++) {\n found = 0\n stri = str1.substring(i, i + 1)\n for (j = 0; j <= str2.length; j++) {\n strj = str2.substring(j, j + 1)\n if (stri === strj) {\n found = 1\n break\n }\n }\n if (found !== 1) {\n return i\n }\n }\n\n return i\n}\n"]}
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/strstr.js b/node_modules/locutus/php/strings/strstr.js new file mode 100644 index 0000000..5a636b6 --- /dev/null +++ b/node_modules/locutus/php/strings/strstr.js @@ -0,0 +1,31 @@ +'use strict'; + +module.exports = function strstr(haystack, needle, bool) { + // discuss at: http://locutus.io/php/strstr/ + // original by: Kevin van Zonneveld (http://kvz.io) + // bugfixed by: Onno Marsman (https://twitter.com/onnomarsman) + // improved by: Kevin van Zonneveld (http://kvz.io) + // example 1: strstr('Kevin van Zonneveld', 'van') + // returns 1: 'van Zonneveld' + // example 2: strstr('Kevin van Zonneveld', 'van', true) + // returns 2: 'Kevin ' + // example 3: strstr('name@example.com', '@') + // returns 3: '@example.com' + // example 4: strstr('name@example.com', '@', true) + // returns 4: 'name' + + var pos = 0; + + haystack += ''; + pos = haystack.indexOf(needle); + if (pos === -1) { + return false; + } else { + if (bool) { + return haystack.substr(0, pos); + } else { + return haystack.slice(pos); + } + } +}; +//# sourceMappingURL=strstr.js.map
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/strstr.js.map b/node_modules/locutus/php/strings/strstr.js.map new file mode 100644 index 0000000..007d714 --- /dev/null +++ b/node_modules/locutus/php/strings/strstr.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/php/strings/strstr.js"],"names":["module","exports","strstr","haystack","needle","bool","pos","indexOf","substr","slice"],"mappings":";;AAAAA,OAAOC,OAAP,GAAiB,SAASC,MAAT,CAAiBC,QAAjB,EAA2BC,MAA3B,EAAmCC,IAAnC,EAAyC;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,MAAIC,MAAM,CAAV;;AAEAH,cAAY,EAAZ;AACAG,QAAMH,SAASI,OAAT,CAAiBH,MAAjB,CAAN;AACA,MAAIE,QAAQ,CAAC,CAAb,EAAgB;AACd,WAAO,KAAP;AACD,GAFD,MAEO;AACL,QAAID,IAAJ,EAAU;AACR,aAAOF,SAASK,MAAT,CAAgB,CAAhB,EAAmBF,GAAnB,CAAP;AACD,KAFD,MAEO;AACL,aAAOH,SAASM,KAAT,CAAeH,GAAf,CAAP;AACD;AACF;AACF,CA3BD","file":"strstr.js","sourcesContent":["module.exports = function strstr (haystack, needle, bool) {\n // discuss at: http://locutus.io/php/strstr/\n // original by: Kevin van Zonneveld (http://kvz.io)\n // bugfixed by: Onno Marsman (https://twitter.com/onnomarsman)\n // improved by: Kevin van Zonneveld (http://kvz.io)\n // example 1: strstr('Kevin van Zonneveld', 'van')\n // returns 1: 'van Zonneveld'\n // example 2: strstr('Kevin van Zonneveld', 'van', true)\n // returns 2: 'Kevin '\n // example 3: strstr('name@example.com', '@')\n // returns 3: '@example.com'\n // example 4: strstr('name@example.com', '@', true)\n // returns 4: 'name'\n\n var pos = 0\n\n haystack += ''\n pos = haystack.indexOf(needle)\n if (pos === -1) {\n return false\n } else {\n if (bool) {\n return haystack.substr(0, pos)\n } else {\n return haystack.slice(pos)\n }\n }\n}\n"]}
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/strtok.js b/node_modules/locutus/php/strings/strtok.js new file mode 100644 index 0000000..74461b0 --- /dev/null +++ b/node_modules/locutus/php/strings/strtok.js @@ -0,0 +1,38 @@ +'use strict'; + +module.exports = function strtok(str, tokens) { + // discuss at: http://locutus.io/php/strtok/ + // original by: Brett Zamir (http://brett-zamir.me) + // note 1: Use tab and newline as tokenizing characters as well + // example 1: var $string = "\t\t\t\nThis is\tan example\nstring\n" + // example 1: var $tok = strtok($string, " \n\t") + // example 1: var $b = '' + // example 1: while ($tok !== false) {$b += "Word="+$tok+"\n"; $tok = strtok(" \n\t");} + // example 1: var $result = $b + // returns 1: "Word=This\nWord=is\nWord=an\nWord=example\nWord=string\n" + + var $global = typeof window !== 'undefined' ? window : global; + $global.$locutus = $global.$locutus || {}; + var $locutus = $global.$locutus; + $locutus.php = $locutus.php || {}; + + if (tokens === undefined) { + tokens = str; + str = $locutus.php.strtokleftOver; + } + if (str.length === 0) { + return false; + } + if (tokens.indexOf(str.charAt(0)) !== -1) { + return strtok(str.substr(1), tokens); + } + for (var i = 0; i < str.length; i++) { + if (tokens.indexOf(str.charAt(i)) !== -1) { + break; + } + } + $locutus.php.strtokleftOver = str.substr(i + 1); + + return str.substring(0, i); +}; +//# sourceMappingURL=strtok.js.map
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/strtok.js.map b/node_modules/locutus/php/strings/strtok.js.map new file mode 100644 index 0000000..de177ae --- /dev/null +++ b/node_modules/locutus/php/strings/strtok.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/php/strings/strtok.js"],"names":["module","exports","strtok","str","tokens","$global","window","global","$locutus","php","undefined","strtokleftOver","length","indexOf","charAt","substr","i","substring"],"mappings":";;AAAAA,OAAOC,OAAP,GAAiB,SAASC,MAAT,CAAiBC,GAAjB,EAAsBC,MAAtB,EAA8B;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,MAAIC,UAAW,OAAOC,MAAP,KAAkB,WAAlB,GAAgCA,MAAhC,GAAyCC,MAAxD;AACAF,UAAQG,QAAR,GAAmBH,QAAQG,QAAR,IAAoB,EAAvC;AACA,MAAIA,WAAWH,QAAQG,QAAvB;AACAA,WAASC,GAAT,GAAeD,SAASC,GAAT,IAAgB,EAA/B;;AAEA,MAAIL,WAAWM,SAAf,EAA0B;AACxBN,aAASD,GAAT;AACAA,UAAMK,SAASC,GAAT,CAAaE,cAAnB;AACD;AACD,MAAIR,IAAIS,MAAJ,KAAe,CAAnB,EAAsB;AACpB,WAAO,KAAP;AACD;AACD,MAAIR,OAAOS,OAAP,CAAeV,IAAIW,MAAJ,CAAW,CAAX,CAAf,MAAkC,CAAC,CAAvC,EAA0C;AACxC,WAAOZ,OAAOC,IAAIY,MAAJ,CAAW,CAAX,CAAP,EAAsBX,MAAtB,CAAP;AACD;AACD,OAAK,IAAIY,IAAI,CAAb,EAAgBA,IAAIb,IAAIS,MAAxB,EAAgCI,GAAhC,EAAqC;AACnC,QAAIZ,OAAOS,OAAP,CAAeV,IAAIW,MAAJ,CAAWE,CAAX,CAAf,MAAkC,CAAC,CAAvC,EAA0C;AACxC;AACD;AACF;AACDR,WAASC,GAAT,CAAaE,cAAb,GAA8BR,IAAIY,MAAJ,CAAWC,IAAI,CAAf,CAA9B;;AAEA,SAAOb,IAAIc,SAAJ,CAAc,CAAd,EAAiBD,CAAjB,CAAP;AACD,CAlCD","file":"strtok.js","sourcesContent":["module.exports = function strtok (str, tokens) {\n // discuss at: http://locutus.io/php/strtok/\n // original by: Brett Zamir (http://brett-zamir.me)\n // note 1: Use tab and newline as tokenizing characters as well\n // example 1: var $string = \"\\t\\t\\t\\nThis is\\tan example\\nstring\\n\"\n // example 1: var $tok = strtok($string, \" \\n\\t\")\n // example 1: var $b = ''\n // example 1: while ($tok !== false) {$b += \"Word=\"+$tok+\"\\n\"; $tok = strtok(\" \\n\\t\");}\n // example 1: var $result = $b\n // returns 1: \"Word=This\\nWord=is\\nWord=an\\nWord=example\\nWord=string\\n\"\n\n var $global = (typeof window !== 'undefined' ? window : global)\n $global.$locutus = $global.$locutus || {}\n var $locutus = $global.$locutus\n $locutus.php = $locutus.php || {}\n\n if (tokens === undefined) {\n tokens = str\n str = $locutus.php.strtokleftOver\n }\n if (str.length === 0) {\n return false\n }\n if (tokens.indexOf(str.charAt(0)) !== -1) {\n return strtok(str.substr(1), tokens)\n }\n for (var i = 0; i < str.length; i++) {\n if (tokens.indexOf(str.charAt(i)) !== -1) {\n break\n }\n }\n $locutus.php.strtokleftOver = str.substr(i + 1)\n\n return str.substring(0, i)\n}\n"]}
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/strtolower.js b/node_modules/locutus/php/strings/strtolower.js new file mode 100644 index 0000000..8309d82 --- /dev/null +++ b/node_modules/locutus/php/strings/strtolower.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports = function strtolower(str) { + // discuss at: http://locutus.io/php/strtolower/ + // original by: Kevin van Zonneveld (http://kvz.io) + // improved by: Onno Marsman (https://twitter.com/onnomarsman) + // example 1: strtolower('Kevin van Zonneveld') + // returns 1: 'kevin van zonneveld' + + return (str + '').toLowerCase(); +}; +//# sourceMappingURL=strtolower.js.map
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/strtolower.js.map b/node_modules/locutus/php/strings/strtolower.js.map new file mode 100644 index 0000000..92ff28a --- /dev/null +++ b/node_modules/locutus/php/strings/strtolower.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/php/strings/strtolower.js"],"names":["module","exports","strtolower","str","toLowerCase"],"mappings":";;AAAAA,OAAOC,OAAP,GAAiB,SAASC,UAAT,CAAqBC,GAArB,EAA0B;AACzC;AACA;AACA;AACA;AACA;;AAEA,SAAO,CAACA,MAAM,EAAP,EACJC,WADI,EAAP;AAED,CATD","file":"strtolower.js","sourcesContent":["module.exports = function strtolower (str) {\n // discuss at: http://locutus.io/php/strtolower/\n // original by: Kevin van Zonneveld (http://kvz.io)\n // improved by: Onno Marsman (https://twitter.com/onnomarsman)\n // example 1: strtolower('Kevin van Zonneveld')\n // returns 1: 'kevin van zonneveld'\n\n return (str + '')\n .toLowerCase()\n}\n"]}
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/strtoupper.js b/node_modules/locutus/php/strings/strtoupper.js new file mode 100644 index 0000000..b30d4a9 --- /dev/null +++ b/node_modules/locutus/php/strings/strtoupper.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports = function strtoupper(str) { + // discuss at: http://locutus.io/php/strtoupper/ + // original by: Kevin van Zonneveld (http://kvz.io) + // improved by: Onno Marsman (https://twitter.com/onnomarsman) + // example 1: strtoupper('Kevin van Zonneveld') + // returns 1: 'KEVIN VAN ZONNEVELD' + + return (str + '').toUpperCase(); +}; +//# sourceMappingURL=strtoupper.js.map
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/strtoupper.js.map b/node_modules/locutus/php/strings/strtoupper.js.map new file mode 100644 index 0000000..e2da8aa --- /dev/null +++ b/node_modules/locutus/php/strings/strtoupper.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/php/strings/strtoupper.js"],"names":["module","exports","strtoupper","str","toUpperCase"],"mappings":";;AAAAA,OAAOC,OAAP,GAAiB,SAASC,UAAT,CAAqBC,GAArB,EAA0B;AACzC;AACA;AACA;AACA;AACA;;AAEA,SAAO,CAACA,MAAM,EAAP,EACJC,WADI,EAAP;AAED,CATD","file":"strtoupper.js","sourcesContent":["module.exports = function strtoupper (str) {\n // discuss at: http://locutus.io/php/strtoupper/\n // original by: Kevin van Zonneveld (http://kvz.io)\n // improved by: Onno Marsman (https://twitter.com/onnomarsman)\n // example 1: strtoupper('Kevin van Zonneveld')\n // returns 1: 'KEVIN VAN ZONNEVELD'\n\n return (str + '')\n .toUpperCase()\n}\n"]}
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/strtr.js b/node_modules/locutus/php/strings/strtr.js new file mode 100644 index 0000000..7c6f35f --- /dev/null +++ b/node_modules/locutus/php/strings/strtr.js @@ -0,0 +1,102 @@ +'use strict'; + +var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; + +module.exports = function strtr(str, trFrom, trTo) { + // discuss at: http://locutus.io/php/strtr/ + // original by: Brett Zamir (http://brett-zamir.me) + // input by: uestla + // input by: Alan C + // input by: Taras Bogach + // input by: jpfle + // bugfixed by: Kevin van Zonneveld (http://kvz.io) + // bugfixed by: Kevin van Zonneveld (http://kvz.io) + // bugfixed by: Brett Zamir (http://brett-zamir.me) + // bugfixed by: Brett Zamir (http://brett-zamir.me) + // example 1: var $trans = {'hello' : 'hi', 'hi' : 'hello'} + // example 1: strtr('hi all, I said hello', $trans) + // returns 1: 'hello all, I said hi' + // example 2: strtr('äaabaåccasdeöoo', 'äåö','aao') + // returns 2: 'aaabaaccasdeooo' + // example 3: strtr('ääääääää', 'ä', 'a') + // returns 3: 'aaaaaaaa' + // example 4: strtr('http', 'pthxyz','xyzpth') + // returns 4: 'zyyx' + // example 5: strtr('zyyx', 'pthxyz','xyzpth') + // returns 5: 'http' + // example 6: strtr('aa', {'a':1,'aa':2}) + // returns 6: '2' + + var krsort = require('../array/krsort'); + var iniSet = require('../info/ini_set'); + + var fr = ''; + var i = 0; + var j = 0; + var lenStr = 0; + var lenFrom = 0; + var sortByReference = false; + var fromTypeStr = ''; + var toTypeStr = ''; + var istr = ''; + var tmpFrom = []; + var tmpTo = []; + var ret = ''; + var match = false; + + // Received replace_pairs? + // Convert to normal trFrom->trTo chars + if ((typeof trFrom === 'undefined' ? 'undefined' : _typeof(trFrom)) === 'object') { + // Not thread-safe; temporarily set to true + // @todo: Don't rely on ini here, use internal krsort instead + sortByReference = iniSet('locutus.sortByReference', false); + trFrom = krsort(trFrom); + iniSet('locutus.sortByReference', sortByReference); + + for (fr in trFrom) { + if (trFrom.hasOwnProperty(fr)) { + tmpFrom.push(fr); + tmpTo.push(trFrom[fr]); + } + } + + trFrom = tmpFrom; + trTo = tmpTo; + } + + // Walk through subject and replace chars when needed + lenStr = str.length; + lenFrom = trFrom.length; + fromTypeStr = typeof trFrom === 'string'; + toTypeStr = typeof trTo === 'string'; + + for (i = 0; i < lenStr; i++) { + match = false; + if (fromTypeStr) { + istr = str.charAt(i); + for (j = 0; j < lenFrom; j++) { + if (istr === trFrom.charAt(j)) { + match = true; + break; + } + } + } else { + for (j = 0; j < lenFrom; j++) { + if (str.substr(i, trFrom[j].length) === trFrom[j]) { + match = true; + // Fast forward + i = i + trFrom[j].length - 1; + break; + } + } + } + if (match) { + ret += toTypeStr ? trTo.charAt(j) : trTo[j]; + } else { + ret += str.charAt(i); + } + } + + return ret; +}; +//# sourceMappingURL=strtr.js.map
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/strtr.js.map b/node_modules/locutus/php/strings/strtr.js.map new file mode 100644 index 0000000..895329b --- /dev/null +++ b/node_modules/locutus/php/strings/strtr.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/php/strings/strtr.js"],"names":["module","exports","strtr","str","trFrom","trTo","krsort","require","iniSet","fr","i","j","lenStr","lenFrom","sortByReference","fromTypeStr","toTypeStr","istr","tmpFrom","tmpTo","ret","match","hasOwnProperty","push","length","charAt","substr"],"mappings":";;;;AAAAA,OAAOC,OAAP,GAAiB,SAASC,KAAT,CAAgBC,GAAhB,EAAqBC,MAArB,EAA6BC,IAA7B,EAAmC;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,MAAIC,SAASC,QAAQ,iBAAR,CAAb;AACA,MAAIC,SAASD,QAAQ,iBAAR,CAAb;;AAEA,MAAIE,KAAK,EAAT;AACA,MAAIC,IAAI,CAAR;AACA,MAAIC,IAAI,CAAR;AACA,MAAIC,SAAS,C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AC5B,YAAIR,IAAIuB,MAAJ,CAAWhB,CAAX,EAAcN,OAAOO,CAAP,EAAUa,MAAxB,MAAoCpB,OAAOO,CAAP,CAAxC,EAAmD;AACjDU,kBAAQ,IAAR;AACA;AACAX,cAAKA,IAAIN,OAAOO,CAAP,EAAUa,MAAf,GAAyB,CAA7B;AACA;AACD;AACF;AACF;AACD,QAAIH,KAAJ,EAAW;AACTD,aAAOJ,YAAYX,KAAKoB,MAAL,CAAYd,CAAZ,CAAZ,GAA6BN,KAAKM,CAAL,CAApC;AACD,KAFD,MAEO;AACLS,aAAOjB,IAAIsB,MAAJ,CAAWf,CAAX,CAAP;AACD;AACF;;AAED,SAAOU,GAAP;AACD,CAhGD","file":"strtr.js","sourcesContent":["module.exports = function strtr (str, trFrom, trTo) {\n // discuss at: http://locutus.io/php/strtr/\n // original by: Brett Zamir (http://brett-zamir.me)\n // input by: uestla\n // input by: Alan C\n // input by: Taras Bogach\n // input by: jpfle\n // bugfixed by: Kevin van Zonneveld (http://kvz.io)\n // bugfixed by: Kevin van Zonneveld (http://kvz.io)\n // bugfixed by: Brett Zamir (http://brett-zamir.me)\n // bugfixed by: Brett Zamir (http://brett-zamir.me)\n // example 1: var $trans = {'hello' : 'hi', 'hi' : 'hello'}\n // example 1: strtr('hi all, I said hello', $trans)\n // returns 1: 'hello all, I said hi'\n // example 2: strtr('äaabaåccasdeöoo', 'äåö','aao')\n // returns 2: 'aaabaaccasdeooo'\n // example 3: strtr('ääääääää', 'ä', 'a')\n // returns 3: 'aaaaaaaa'\n // example 4: strtr('http', 'pthxyz','xyzpth')\n // returns 4: 'zyyx'\n // example 5: strtr('zyyx', 'pthxyz','xyzpth')\n // returns 5: 'http'\n // example 6: strtr('aa', {'a':1,'aa':2})\n // returns 6: '2'\n\n var krsort = require('../array/krsort')\n var iniSet = require('../info/ini_set')\n\n var fr = ''\n var i = 0\n var j = 0\n var lenStr = 0\n var lenFrom = 0\n var sortByReference = false\n var fromTypeStr = ''\n var toTypeStr = ''\n var istr = ''\n var tmpFrom = []\n var tmpTo = []\n var ret = ''\n var match = false\n\n // Received replace_pairs?\n // Convert to normal trFrom->trTo chars\n if (typeof trFrom === 'object') {\n // Not thread-safe; temporarily set to true\n // @todo: Don't rely on ini here, use internal krsort instead\n sortByReference = iniSet('locutus.sortByReference', false)\n trFrom = krsort(trFrom)\n iniSet('locutus.sortByReference', sortByReference)\n\n for (fr in trFrom) {\n if (trFrom.hasOwnProperty(fr)) {\n tmpFrom.push(fr)\n tmpTo.push(trFrom[fr])\n }\n }\n\n trFrom = tmpFrom\n trTo = tmpTo\n }\n\n // Walk through subject and replace chars when needed\n lenStr = str.length\n lenFrom = trFrom.length\n fromTypeStr = typeof trFrom === 'string'\n toTypeStr = typeof trTo === 'string'\n\n for (i = 0; i < lenStr; i++) {\n match = false\n if (fromTypeStr) {\n istr = str.charAt(i)\n for (j = 0; j < lenFrom; j++) {\n if (istr === trFrom.charAt(j)) {\n match = true\n break\n }\n }\n } else {\n for (j = 0; j < lenFrom; j++) {\n if (str.substr(i, trFrom[j].length) === trFrom[j]) {\n match = true\n // Fast forward\n i = (i + trFrom[j].length) - 1\n break\n }\n }\n }\n if (match) {\n ret += toTypeStr ? trTo.charAt(j) : trTo[j]\n } else {\n ret += str.charAt(i)\n }\n }\n\n return ret\n}\n"]}
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/substr.js b/node_modules/locutus/php/strings/substr.js new file mode 100644 index 0000000..3498296 --- /dev/null +++ b/node_modules/locutus/php/strings/substr.js @@ -0,0 +1,124 @@ +'use strict'; + +module.exports = function substr(str, start, len) { + // discuss at: http://locutus.io/php/substr/ + // original by: Martijn Wieringa + // bugfixed by: T.Wild + // improved by: Onno Marsman (https://twitter.com/onnomarsman) + // improved by: Brett Zamir (http://brett-zamir.me) + // revised by: Theriault (https://github.com/Theriault) + // note 1: Handles rare Unicode characters if 'unicode.semantics' ini (PHP6) is set to 'on' + // example 1: substr('abcdef', 0, -1) + // returns 1: 'abcde' + // example 2: substr(2, 0, -6) + // returns 2: false + // example 3: ini_set('unicode.semantics', 'on') + // example 3: substr('a\uD801\uDC00', 0, -1) + // returns 3: 'a' + // example 4: ini_set('unicode.semantics', 'on') + // example 4: substr('a\uD801\uDC00', 0, 2) + // returns 4: 'a\uD801\uDC00' + // example 5: ini_set('unicode.semantics', 'on') + // example 5: substr('a\uD801\uDC00', -1, 1) + // returns 5: '\uD801\uDC00' + // example 6: ini_set('unicode.semantics', 'on') + // example 6: substr('a\uD801\uDC00z\uD801\uDC00', -3, 2) + // returns 6: '\uD801\uDC00z' + // example 7: ini_set('unicode.semantics', 'on') + // example 7: substr('a\uD801\uDC00z\uD801\uDC00', -3, -1) + // returns 7: '\uD801\uDC00z' + // test: skip-3 skip-4 skip-5 skip-6 skip-7 + + str += ''; + var end = str.length; + + var iniVal = (typeof require !== 'undefined' ? require('../info/ini_get')('unicode.emantics') : undefined) || 'off'; + + if (iniVal === 'off') { + // assumes there are no non-BMP characters; + // if there may be such characters, then it is best to turn it on (critical in true XHTML/XML) + if (start < 0) { + start += end; + } + if (typeof len !== 'undefined') { + if (len < 0) { + end = len + end; + } else { + end = len + start; + } + } + + // PHP returns false if start does not fall within the string. + // PHP returns false if the calculated end comes before the calculated start. + // PHP returns an empty string if start and end are the same. + // Otherwise, PHP returns the portion of the string from start to end. + if (start >= str.length || start < 0 || start > end) { + return false; + } + + return str.slice(start, end); + } + + // Full-blown Unicode including non-Basic-Multilingual-Plane characters + var i = 0; + var allBMP = true; + var es = 0; + var el = 0; + var se = 0; + var ret = ''; + + for (i = 0; i < str.length; i++) { + if (/[\uD800-\uDBFF]/.test(str.charAt(i)) && /[\uDC00-\uDFFF]/.test(str.charAt(i + 1))) { + allBMP = false; + break; + } + } + + if (!allBMP) { + if (start < 0) { + for (i = end - 1, es = start += end; i >= es; i--) { + if (/[\uDC00-\uDFFF]/.test(str.charAt(i)) && /[\uD800-\uDBFF]/.test(str.charAt(i - 1))) { + start--; + es--; + } + } + } else { + var surrogatePairs = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g; + while (surrogatePairs.exec(str) !== null) { + var li = surrogatePairs.lastIndex; + if (li - 2 < start) { + start++; + } else { + break; + } + } + } + + if (start >= end || start < 0) { + return false; + } + if (len < 0) { + for (i = end - 1, el = end += len; i >= el; i--) { + if (/[\uDC00-\uDFFF]/.test(str.charAt(i)) && /[\uD800-\uDBFF]/.test(str.charAt(i - 1))) { + end--; + el--; + } + } + if (start > end) { + return false; + } + return str.slice(start, end); + } else { + se = start + len; + for (i = start; i < se; i++) { + ret += str.charAt(i); + if (/[\uD800-\uDBFF]/.test(str.charAt(i)) && /[\uDC00-\uDFFF]/.test(str.charAt(i + 1))) { + // Go one further, since one of the "characters" is part of a surrogate pair + se++; + } + } + return ret; + } + } +}; +//# sourceMappingURL=substr.js.map
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/substr.js.map b/node_modules/locutus/php/strings/substr.js.map new file mode 100644 index 0000000..c05fb4a --- /dev/null +++ b/node_modules/locutus/php/strings/substr.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/php/strings/substr.js"],"names":["module","exports","substr","str","start","len","end","length","iniVal","require","undefined","slice","i","allBMP","es","el","se","ret","test","charAt","surrogatePairs","exec","li","lastIndex"],"mappings":";;AAAAA,OAAOC,OAAP,GAAiB,SAASC,MAAT,CAAiBC,GAAjB,EAAsBC,KAAtB,EAA6BC,GAA7B,EAAkC;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEAF,SAAO,EAAP;AACA,MAAIG,MAAMH,IAAII,MAAd;;AAEA,MAAIC,SAAS,CAAC,OAAOC,OAAP,KAAmB,WAAnB,GAAiCA,QAAQ,iBAAR,EAA2B,kBAA3B,CAAjC,GAAkFC,SAAnF,KAAiG,KAA9G;;AAEA,MAAIF,WAAW,KAAf,EAAsB;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AiB,iCAArB;AACA,aAAQA,eAAeC,IAAf,CAAoBlB,GAApB,CAAD,KAA+B,IAAtC,EAA4C;AAC1C,YAAImB,KAAKF,eAAeG,SAAxB;AACA,YAAID,KAAK,CAAL,GAASlB,KAAb,EAAoB;AAClBA;AACD,SAFD,MAEO;AACL;AACD;AACF;AACF;;AAED,QAAIA,SAASE,GAAT,IAAgBF,QAAQ,CAA5B,EAA+B;AAC7B,aAAO,KAAP;AACD;AACD,QAAIC,MAAM,CAAV,EAAa;AACX,WAAKO,IAAIN,MAAM,CAAV,EAAaS,KAAMT,OAAOD,GAA/B,EAAqCO,KAAKG,EAA1C,EAA8CH,GAA9C,EAAmD;AACjD,YAAI,kBAAkBM,IAAlB,CAAuBf,IAAIgB,MAAJ,CAAWP,CAAX,CAAvB,KAAyC,kBAAkBM,IAAlB,CAAuBf,IAAIgB,MAAJ,CAAWP,IAAI,CAAf,CAAvB,CAA7C,EAAwF;AACtFN;AACAS;AACD;AACF;AACD,UAAIX,QAAQE,GAAZ,EAAiB;AACf,eAAO,KAAP;AACD;AACD,aAAOH,IAAIQ,KAAJ,CAAUP,KAAV,EAAiBE,GAAjB,CAAP;AACD,KAXD,MAWO;AACLU,WAAKZ,QAAQC,GAAb;AACA,WAAKO,IAAIR,KAAT,EAAgBQ,IAAII,EAApB,EAAwBJ,GAAxB,EAA6B;AAC3BK,eAAOd,IAAIgB,MAAJ,CAAWP,CAAX,CAAP;AACA,YAAI,kBAAkBM,IAAlB,CAAuBf,IAAIgB,MAAJ,CAAWP,CAAX,CAAvB,KAAyC,kBAAkBM,IAAlB,CAAuBf,IAAIgB,MAAJ,CAAWP,IAAI,CAAf,CAAvB,CAA7C,EAAwF;AACtF;AACAI;AACD;AACF;AACD,aAAOC,GAAP;AACD;AACF;AACF,CAxHD","file":"substr.js","sourcesContent":["module.exports = function substr (str, start, len) {\n // discuss at: http://locutus.io/php/substr/\n // original by: Martijn Wieringa\n // bugfixed by: T.Wild\n // improved by: Onno Marsman (https://twitter.com/onnomarsman)\n // improved by: Brett Zamir (http://brett-zamir.me)\n // revised by: Theriault (https://github.com/Theriault)\n // note 1: Handles rare Unicode characters if 'unicode.semantics' ini (PHP6) is set to 'on'\n // example 1: substr('abcdef', 0, -1)\n // returns 1: 'abcde'\n // example 2: substr(2, 0, -6)\n // returns 2: false\n // example 3: ini_set('unicode.semantics', 'on')\n // example 3: substr('a\\uD801\\uDC00', 0, -1)\n // returns 3: 'a'\n // example 4: ini_set('unicode.semantics', 'on')\n // example 4: substr('a\\uD801\\uDC00', 0, 2)\n // returns 4: 'a\\uD801\\uDC00'\n // example 5: ini_set('unicode.semantics', 'on')\n // example 5: substr('a\\uD801\\uDC00', -1, 1)\n // returns 5: '\\uD801\\uDC00'\n // example 6: ini_set('unicode.semantics', 'on')\n // example 6: substr('a\\uD801\\uDC00z\\uD801\\uDC00', -3, 2)\n // returns 6: '\\uD801\\uDC00z'\n // example 7: ini_set('unicode.semantics', 'on')\n // example 7: substr('a\\uD801\\uDC00z\\uD801\\uDC00', -3, -1)\n // returns 7: '\\uD801\\uDC00z'\n // test: skip-3 skip-4 skip-5 skip-6 skip-7\n\n str += ''\n var end = str.length\n\n var iniVal = (typeof require !== 'undefined' ? require('../info/ini_get')('unicode.emantics') : undefined) || 'off'\n\n if (iniVal === 'off') {\n // assumes there are no non-BMP characters;\n // if there may be such characters, then it is best to turn it on (critical in true XHTML/XML)\n if (start < 0) {\n start += end\n }\n if (typeof len !== 'undefined') {\n if (len < 0) {\n end = len + end\n } else {\n end = len + start\n }\n }\n\n // PHP returns false if start does not fall within the string.\n // PHP returns false if the calculated end comes before the calculated start.\n // PHP returns an empty string if start and end are the same.\n // Otherwise, PHP returns the portion of the string from start to end.\n if (start >= str.length || start < 0 || start > end) {\n return false\n }\n\n return str.slice(start, end)\n }\n\n // Full-blown Unicode including non-Basic-Multilingual-Plane characters\n var i = 0\n var allBMP = true\n var es = 0\n var el = 0\n var se = 0\n var ret = ''\n\n for (i = 0; i < str.length; i++) {\n if (/[\\uD800-\\uDBFF]/.test(str.charAt(i)) && /[\\uDC00-\\uDFFF]/.test(str.charAt(i + 1))) {\n allBMP = false\n break\n }\n }\n\n if (!allBMP) {\n if (start < 0) {\n for (i = end - 1, es = (start += end); i >= es; i--) {\n if (/[\\uDC00-\\uDFFF]/.test(str.charAt(i)) && /[\\uD800-\\uDBFF]/.test(str.charAt(i - 1))) {\n start--\n es--\n }\n }\n } else {\n var surrogatePairs = /[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]/g\n while ((surrogatePairs.exec(str)) !== null) {\n var li = surrogatePairs.lastIndex\n if (li - 2 < start) {\n start++\n } else {\n break\n }\n }\n }\n\n if (start >= end || start < 0) {\n return false\n }\n if (len < 0) {\n for (i = end - 1, el = (end += len); i >= el; i--) {\n if (/[\\uDC00-\\uDFFF]/.test(str.charAt(i)) && /[\\uD800-\\uDBFF]/.test(str.charAt(i - 1))) {\n end--\n el--\n }\n }\n if (start > end) {\n return false\n }\n return str.slice(start, end)\n } else {\n se = start + len\n for (i = start; i < se; i++) {\n ret += str.charAt(i)\n if (/[\\uD800-\\uDBFF]/.test(str.charAt(i)) && /[\\uDC00-\\uDFFF]/.test(str.charAt(i + 1))) {\n // Go one further, since one of the \"characters\" is part of a surrogate pair\n se++\n }\n }\n return ret\n }\n }\n}\n"]}
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/substr_compare.js b/node_modules/locutus/php/strings/substr_compare.js new file mode 100644 index 0000000..81e09cd --- /dev/null +++ b/node_modules/locutus/php/strings/substr_compare.js @@ -0,0 +1,39 @@ +'use strict'; + +module.exports = function substr_compare(mainStr, str, offset, length, caseInsensitivity) { + // eslint-disable-line camelcase + // discuss at: http://locutus.io/php/substr_compare/ + // original by: Brett Zamir (http://brett-zamir.me) + // original by: strcasecmp, strcmp + // example 1: substr_compare("abcde", "bc", 1, 2) + // returns 1: 0 + + if (!offset && offset !== 0) { + throw new Error('Missing offset for substr_compare()'); + } + + if (offset < 0) { + offset = mainStr.length + offset; + } + + if (length && length > mainStr.length - offset) { + return false; + } + length = length || mainStr.length - offset; + + mainStr = mainStr.substr(offset, length); + // Should only compare up to the desired length + str = str.substr(0, length); + if (caseInsensitivity) { + // Works as strcasecmp + mainStr = (mainStr + '').toLowerCase(); + str = (str + '').toLowerCase(); + if (mainStr === str) { + return 0; + } + return mainStr > str ? 1 : -1; + } + // Works as strcmp + return mainStr === str ? 0 : mainStr > str ? 1 : -1; +}; +//# sourceMappingURL=substr_compare.js.map
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/substr_compare.js.map b/node_modules/locutus/php/strings/substr_compare.js.map new file mode 100644 index 0000000..6303978 --- /dev/null +++ b/node_modules/locutus/php/strings/substr_compare.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/php/strings/substr_compare.js"],"names":["module","exports","substr_compare","mainStr","str","offset","length","caseInsensitivity","Error","substr","toLowerCase"],"mappings":";;AAAAA,OAAOC,OAAP,GAAiB,SAASC,cAAT,CAAyBC,OAAzB,EAAkCC,GAAlC,EAAuCC,MAAvC,EAA+CC,MAA/C,EAAuDC,iBAAvD,EAA0E;AAAE;AAC3F;AACA;AACA;AACA;AACA;;AAEA,MAAI,CAACF,MAAD,IAAWA,WAAW,CAA1B,EAA6B;AAC3B,UAAM,IAAIG,KAAJ,CAAU,qCAAV,CAAN;AACD;;AAED,MAAIH,SAAS,CAAb,EAAgB;AACdA,aAASF,QAAQG,MAAR,GAAiBD,MAA1B;AACD;;AAED,MAAIC,UAAUA,SAAUH,QAAQG,MAAR,GAAiBD,MAAzC,EAAkD;AAChD,WAAO,KAAP;AACD;AACDC,WAASA,UAAUH,QAAQG,MAAR,GAAiBD,MAApC;;AAEAF,YAAUA,QAAQM,MAAR,CAAeJ,MAAf,EAAuBC,MAAvB,CAAV;AACA;AACAF,QAAMA,IAAIK,MAAJ,CAAW,CAAX,EAAcH,MAAd,CAAN;AACA,MAAIC,iBAAJ,EAAuB;AACrB;AACAJ,cAAU,CAACA,UAAU,EAAX,EAAeO,WAAf,EAAV;AACAN,UAAM,CAACA,MAAM,EAAP,EAAWM,WAAX,EAAN;AACA,QAAIP,YAAYC,GAAhB,EAAqB;AACnB,aAAO,CAAP;AACD;AACD,WAAQD,UAAUC,GAAX,GAAkB,CAAlB,GAAsB,CAAC,CAA9B;AACD;AACD;AACA,SAASD,YAAYC,GAAb,GAAoB,CAApB,GAA0BD,UAAUC,GAAX,GAAkB,CAAlB,GAAsB,CAAC,CAAxD;AACD,CAlCD","file":"substr_compare.js","sourcesContent":["module.exports = function substr_compare (mainStr, str, offset, length, caseInsensitivity) { // eslint-disable-line camelcase\n // discuss at: http://locutus.io/php/substr_compare/\n // original by: Brett Zamir (http://brett-zamir.me)\n // original by: strcasecmp, strcmp\n // example 1: substr_compare(\"abcde\", \"bc\", 1, 2)\n // returns 1: 0\n\n if (!offset && offset !== 0) {\n throw new Error('Missing offset for substr_compare()')\n }\n\n if (offset < 0) {\n offset = mainStr.length + offset\n }\n\n if (length && length > (mainStr.length - offset)) {\n return false\n }\n length = length || mainStr.length - offset\n\n mainStr = mainStr.substr(offset, length)\n // Should only compare up to the desired length\n str = str.substr(0, length)\n if (caseInsensitivity) {\n // Works as strcasecmp\n mainStr = (mainStr + '').toLowerCase()\n str = (str + '').toLowerCase()\n if (mainStr === str) {\n return 0\n }\n return (mainStr > str) ? 1 : -1\n }\n // Works as strcmp\n return ((mainStr === str) ? 0 : ((mainStr > str) ? 1 : -1))\n}\n"]}
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/substr_count.js b/node_modules/locutus/php/strings/substr_count.js new file mode 100644 index 0000000..9a17e93 --- /dev/null +++ b/node_modules/locutus/php/strings/substr_count.js @@ -0,0 +1,41 @@ +'use strict'; + +module.exports = function substr_count(haystack, needle, offset, length) { + // eslint-disable-line camelcase + // discuss at: http://locutus.io/php/substr_count/ + // original by: Kevin van Zonneveld (http://kvz.io) + // bugfixed by: Onno Marsman (https://twitter.com/onnomarsman) + // improved by: Brett Zamir (http://brett-zamir.me) + // improved by: Thomas + // example 1: substr_count('Kevin van Zonneveld', 'e') + // returns 1: 3 + // example 2: substr_count('Kevin van Zonneveld', 'K', 1) + // returns 2: 0 + // example 3: substr_count('Kevin van Zonneveld', 'Z', 0, 10) + // returns 3: false + + var cnt = 0; + + haystack += ''; + needle += ''; + if (isNaN(offset)) { + offset = 0; + } + if (isNaN(length)) { + length = 0; + } + if (needle.length === 0) { + return false; + } + offset--; + + while ((offset = haystack.indexOf(needle, offset + 1)) !== -1) { + if (length > 0 && offset + needle.length > length) { + return false; + } + cnt++; + } + + return cnt; +}; +//# sourceMappingURL=substr_count.js.map
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/substr_count.js.map b/node_modules/locutus/php/strings/substr_count.js.map new file mode 100644 index 0000000..2c0a4a7 --- /dev/null +++ b/node_modules/locutus/php/strings/substr_count.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/php/strings/substr_count.js"],"names":["module","exports","substr_count","haystack","needle","offset","length","cnt","isNaN","indexOf"],"mappings":";;AAAAA,OAAOC,OAAP,GAAiB,SAASC,YAAT,CAAuBC,QAAvB,EAAiCC,MAAjC,EAAyCC,MAAzC,EAAiDC,MAAjD,EAAyD;AAAE;AAC1E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,MAAIC,MAAM,CAAV;;AAEAJ,cAAY,EAAZ;AACAC,YAAU,EAAV;AACA,MAAII,MAAMH,MAAN,CAAJ,EAAmB;AACjBA,aAAS,CAAT;AACD;AACD,MAAIG,MAAMF,MAAN,CAAJ,EAAmB;AACjBA,aAAS,CAAT;AACD;AACD,MAAIF,OAAOE,MAAP,KAAkB,CAAtB,EAAyB;AACvB,WAAO,KAAP;AACD;AACDD;;AAEA,SAAO,CAACA,SAASF,SAASM,OAAT,CAAiBL,MAAjB,EAAyBC,SAAS,CAAlC,CAAV,MAAoD,CAAC,CAA5D,EAA+D;AAC7D,QAAIC,SAAS,CAAT,IAAeD,SAASD,OAAOE,MAAjB,GAA2BA,MAA7C,EAAqD;AACnD,aAAO,KAAP;AACD;AACDC;AACD;;AAED,SAAOA,GAAP;AACD,CApCD","file":"substr_count.js","sourcesContent":["module.exports = function substr_count (haystack, needle, offset, length) { // eslint-disable-line camelcase\n // discuss at: http://locutus.io/php/substr_count/\n // original by: Kevin van Zonneveld (http://kvz.io)\n // bugfixed by: Onno Marsman (https://twitter.com/onnomarsman)\n // improved by: Brett Zamir (http://brett-zamir.me)\n // improved by: Thomas\n // example 1: substr_count('Kevin van Zonneveld', 'e')\n // returns 1: 3\n // example 2: substr_count('Kevin van Zonneveld', 'K', 1)\n // returns 2: 0\n // example 3: substr_count('Kevin van Zonneveld', 'Z', 0, 10)\n // returns 3: false\n\n var cnt = 0\n\n haystack += ''\n needle += ''\n if (isNaN(offset)) {\n offset = 0\n }\n if (isNaN(length)) {\n length = 0\n }\n if (needle.length === 0) {\n return false\n }\n offset--\n\n while ((offset = haystack.indexOf(needle, offset + 1)) !== -1) {\n if (length > 0 && (offset + needle.length) > length) {\n return false\n }\n cnt++\n }\n\n return cnt\n}\n"]}
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/substr_replace.js b/node_modules/locutus/php/strings/substr_replace.js new file mode 100644 index 0000000..9778789 --- /dev/null +++ b/node_modules/locutus/php/strings/substr_replace.js @@ -0,0 +1,32 @@ +'use strict'; + +module.exports = function substr_replace(str, replace, start, length) { + // eslint-disable-line camelcase + // discuss at: http://locutus.io/php/substr_replace/ + // original by: Brett Zamir (http://brett-zamir.me) + // example 1: substr_replace('ABCDEFGH:/MNRPQR/', 'bob', 0) + // returns 1: 'bob' + // example 2: var $var = 'ABCDEFGH:/MNRPQR/' + // example 2: substr_replace($var, 'bob', 0, $var.length) + // returns 2: 'bob' + // example 3: substr_replace('ABCDEFGH:/MNRPQR/', 'bob', 0, 0) + // returns 3: 'bobABCDEFGH:/MNRPQR/' + // example 4: substr_replace('ABCDEFGH:/MNRPQR/', 'bob', 10, -1) + // returns 4: 'ABCDEFGH:/bob/' + // example 5: substr_replace('ABCDEFGH:/MNRPQR/', 'bob', -7, -1) + // returns 5: 'ABCDEFGH:/bob/' + // example 6: substr_replace('ABCDEFGH:/MNRPQR/', '', 10, -1) + // returns 6: 'ABCDEFGH://' + + if (start < 0) { + // start position in str + start = start + str.length; + } + length = length !== undefined ? length : str.length; + if (length < 0) { + length = length + str.length - start; + } + + return [str.slice(0, start), replace.substr(0, length), replace.slice(length), str.slice(start + length)].join(''); +}; +//# sourceMappingURL=substr_replace.js.map
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/substr_replace.js.map b/node_modules/locutus/php/strings/substr_replace.js.map new file mode 100644 index 0000000..701d204 --- /dev/null +++ b/node_modules/locutus/php/strings/substr_replace.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/php/strings/substr_replace.js"],"names":["module","exports","substr_replace","str","replace","start","length","undefined","slice","substr","join"],"mappings":";;AAAAA,OAAOC,OAAP,GAAiB,SAASC,cAAT,CAAyBC,GAAzB,EAA8BC,OAA9B,EAAuCC,KAAvC,EAA8CC,MAA9C,EAAsD;AAAE;AACvE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,MAAID,QAAQ,CAAZ,EAAe;AACb;AACAA,YAAQA,QAAQF,IAAIG,MAApB;AACD;AACDA,WAASA,WAAWC,SAAX,GAAuBD,MAAvB,GAAgCH,IAAIG,MAA7C;AACA,MAAIA,SAAS,CAAb,EAAgB;AACdA,aAASA,SAASH,IAAIG,MAAb,GAAsBD,KAA/B;AACD;;AAED,SAAO,CACLF,IAAIK,KAAJ,CAAU,CAAV,EAAaH,KAAb,CADK,EAELD,QAAQK,MAAR,CAAe,CAAf,EAAkBH,MAAlB,CAFK,EAGLF,QAAQI,KAAR,CAAcF,MAAd,CAHK,EAILH,IAAIK,KAAJ,CAAUH,QAAQC,MAAlB,CAJK,EAKLI,IALK,CAKA,EALA,CAAP;AAMD,CAhCD","file":"substr_replace.js","sourcesContent":["module.exports = function substr_replace (str, replace, start, length) { // eslint-disable-line camelcase\n // discuss at: http://locutus.io/php/substr_replace/\n // original by: Brett Zamir (http://brett-zamir.me)\n // example 1: substr_replace('ABCDEFGH:/MNRPQR/', 'bob', 0)\n // returns 1: 'bob'\n // example 2: var $var = 'ABCDEFGH:/MNRPQR/'\n // example 2: substr_replace($var, 'bob', 0, $var.length)\n // returns 2: 'bob'\n // example 3: substr_replace('ABCDEFGH:/MNRPQR/', 'bob', 0, 0)\n // returns 3: 'bobABCDEFGH:/MNRPQR/'\n // example 4: substr_replace('ABCDEFGH:/MNRPQR/', 'bob', 10, -1)\n // returns 4: 'ABCDEFGH:/bob/'\n // example 5: substr_replace('ABCDEFGH:/MNRPQR/', 'bob', -7, -1)\n // returns 5: 'ABCDEFGH:/bob/'\n // example 6: substr_replace('ABCDEFGH:/MNRPQR/', '', 10, -1)\n // returns 6: 'ABCDEFGH://'\n\n if (start < 0) {\n // start position in str\n start = start + str.length\n }\n length = length !== undefined ? length : str.length\n if (length < 0) {\n length = length + str.length - start\n }\n\n return [\n str.slice(0, start),\n replace.substr(0, length),\n replace.slice(length),\n str.slice(start + length)\n ].join('')\n}\n"]}
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/trim.js b/node_modules/locutus/php/strings/trim.js new file mode 100644 index 0000000..49b75fe --- /dev/null +++ b/node_modules/locutus/php/strings/trim.js @@ -0,0 +1,48 @@ +'use strict'; + +module.exports = function trim(str, charlist) { + // discuss at: http://locutus.io/php/trim/ + // original by: Kevin van Zonneveld (http://kvz.io) + // improved by: mdsjack (http://www.mdsjack.bo.it) + // improved by: Alexander Ermolaev (http://snippets.dzone.com/user/AlexanderErmolaev) + // improved by: Kevin van Zonneveld (http://kvz.io) + // improved by: Steven Levithan (http://blog.stevenlevithan.com) + // improved by: Jack + // input by: Erkekjetter + // input by: DxGx + // bugfixed by: Onno Marsman (https://twitter.com/onnomarsman) + // example 1: trim(' Kevin van Zonneveld ') + // returns 1: 'Kevin van Zonneveld' + // example 2: trim('Hello World', 'Hdle') + // returns 2: 'o Wor' + // example 3: trim(16, 1) + // returns 3: '6' + + var whitespace = [' ', '\n', '\r', '\t', '\f', '\x0b', '\xa0', '\u2000', '\u2001', '\u2002', '\u2003', '\u2004', '\u2005', '\u2006', '\u2007', '\u2008', '\u2009', '\u200A', '\u200B', '\u2028', '\u2029', '\u3000'].join(''); + var l = 0; + var i = 0; + str += ''; + + if (charlist) { + whitespace = (charlist + '').replace(/([[\]().?/*{}+$^:])/g, '$1'); + } + + l = str.length; + for (i = 0; i < l; i++) { + if (whitespace.indexOf(str.charAt(i)) === -1) { + str = str.substring(i); + break; + } + } + + l = str.length; + for (i = l - 1; i >= 0; i--) { + if (whitespace.indexOf(str.charAt(i)) === -1) { + str = str.substring(0, i + 1); + break; + } + } + + return whitespace.indexOf(str.charAt(0)) === -1 ? str : ''; +}; +//# sourceMappingURL=trim.js.map
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/trim.js.map b/node_modules/locutus/php/strings/trim.js.map new file mode 100644 index 0000000..9d1638e --- /dev/null +++ b/node_modules/locutus/php/strings/trim.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/php/strings/trim.js"],"names":["module","exports","trim","str","charlist","whitespace","join","l","i","replace","length","indexOf","charAt","substring"],"mappings":";;AAAAA,OAAOC,OAAP,GAAiB,SAASC,IAAT,CAAeC,GAAf,EAAoBC,QAApB,EAA8B;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,MAAIC,aAAa,CACf,GADe,EAEf,IAFe,EAGf,IAHe,EAIf,IAJe,EAKf,IALe,EAMf,MANe,EAOf,MAPe,EAQf,QARe,EASf,QATe,EAUf,QAVe,EAWf,QAXe,EAYf,QAZe,EAaf,QAbe,EAcf,QAde,EAef,QAfe,EAgBf,QAhBe,EAiBf,QAjBe,EAkBf,QAlBe,EAmBf,QAnBe,EAoBf,QApBe,EAqBf,QArBe,EAsBf,QAtBe,EAuBfC,IAvBe,CAuBV,EAvBU,CAAjB;AAwBA,MAAIC,IAAI,CAAR;AACA,MAAIC,IAAI,CAAR;AACAL,SAAO,EAAP;;AAEA,MAAIC,QAAJ,EAAc;AACZC,iBAAa,CAACD,WAAW,EAAZ,EAAgBK,OAAhB,CAAwB,sBAAxB,EAAgD,IAAhD,CAAb;AACD;;AAEDF,MAAIJ,IAAIO,MAAR;AACA,OAAKF,IAAI,CAAT,EAAYA,IAAID,CAAhB,EAAmBC,GAAnB,EAAwB;AACtB,QAAIH,WAAWM,OAAX,CAAmBR,IAAIS,MAAJ,CAAWJ,CAAX,CAAnB,MAAsC,CAAC,CAA3C,EAA8C;AAC5CL,YAAMA,IAAIU,SAAJ,CAAcL,CAAd,CAAN;AACA;AACD;AACF;;AAEDD,MAAIJ,IAAIO,MAAR;AACA,OAAKF,IAAID,IAAI,CAAb,EAAgBC,KAAK,CAArB,EAAwBA,GAAxB,EAA6B;AAC3B,QAAIH,WAAWM,OAAX,CAAmBR,IAAIS,MAAJ,CAAWJ,CAAX,CAAnB,MAAsC,CAAC,CAA3C,EAA8C;AAC5CL,YAAMA,IAAIU,SAAJ,CAAc,CAAd,EAAiBL,IAAI,CAArB,CAAN;AACA;AACD;AACF;;AAED,SAAOH,WAAWM,OAAX,CAAmBR,IAAIS,MAAJ,CAAW,CAAX,CAAnB,MAAsC,CAAC,CAAvC,GAA2CT,GAA3C,GAAiD,EAAxD;AACD,CAnED","file":"trim.js","sourcesContent":["module.exports = function trim (str, charlist) {\n // discuss at: http://locutus.io/php/trim/\n // original by: Kevin van Zonneveld (http://kvz.io)\n // improved by: mdsjack (http://www.mdsjack.bo.it)\n // improved by: Alexander Ermolaev (http://snippets.dzone.com/user/AlexanderErmolaev)\n // improved by: Kevin van Zonneveld (http://kvz.io)\n // improved by: Steven Levithan (http://blog.stevenlevithan.com)\n // improved by: Jack\n // input by: Erkekjetter\n // input by: DxGx\n // bugfixed by: Onno Marsman (https://twitter.com/onnomarsman)\n // example 1: trim(' Kevin van Zonneveld ')\n // returns 1: 'Kevin van Zonneveld'\n // example 2: trim('Hello World', 'Hdle')\n // returns 2: 'o Wor'\n // example 3: trim(16, 1)\n // returns 3: '6'\n\n var whitespace = [\n ' ',\n '\\n',\n '\\r',\n '\\t',\n '\\f',\n '\\x0b',\n '\\xa0',\n '\\u2000',\n '\\u2001',\n '\\u2002',\n '\\u2003',\n '\\u2004',\n '\\u2005',\n '\\u2006',\n '\\u2007',\n '\\u2008',\n '\\u2009',\n '\\u200a',\n '\\u200b',\n '\\u2028',\n '\\u2029',\n '\\u3000'\n ].join('')\n var l = 0\n var i = 0\n str += ''\n\n if (charlist) {\n whitespace = (charlist + '').replace(/([[\\]().?/*{}+$^:])/g, '$1')\n }\n\n l = str.length\n for (i = 0; i < l; i++) {\n if (whitespace.indexOf(str.charAt(i)) === -1) {\n str = str.substring(i)\n break\n }\n }\n\n l = str.length\n for (i = l - 1; i >= 0; i--) {\n if (whitespace.indexOf(str.charAt(i)) === -1) {\n str = str.substring(0, i + 1)\n break\n }\n }\n\n return whitespace.indexOf(str.charAt(0)) === -1 ? str : ''\n}\n"]}
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/ucfirst.js b/node_modules/locutus/php/strings/ucfirst.js new file mode 100644 index 0000000..595f980 --- /dev/null +++ b/node_modules/locutus/php/strings/ucfirst.js @@ -0,0 +1,15 @@ +'use strict'; + +module.exports = function ucfirst(str) { + // discuss at: http://locutus.io/php/ucfirst/ + // original by: Kevin van Zonneveld (http://kvz.io) + // bugfixed by: Onno Marsman (https://twitter.com/onnomarsman) + // improved by: Brett Zamir (http://brett-zamir.me) + // example 1: ucfirst('kevin van zonneveld') + // returns 1: 'Kevin van zonneveld' + + str += ''; + var f = str.charAt(0).toUpperCase(); + return f + str.substr(1); +}; +//# sourceMappingURL=ucfirst.js.map
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/ucfirst.js.map b/node_modules/locutus/php/strings/ucfirst.js.map new file mode 100644 index 0000000..6bf6997 --- /dev/null +++ b/node_modules/locutus/php/strings/ucfirst.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/php/strings/ucfirst.js"],"names":["module","exports","ucfirst","str","f","charAt","toUpperCase","substr"],"mappings":";;AAAAA,OAAOC,OAAP,GAAiB,SAASC,OAAT,CAAkBC,GAAlB,EAAuB;AACtC;AACA;AACA;AACA;AACA;AACA;;AAEAA,SAAO,EAAP;AACA,MAAIC,IAAID,IAAIE,MAAJ,CAAW,CAAX,EACLC,WADK,EAAR;AAEA,SAAOF,IAAID,IAAII,MAAJ,CAAW,CAAX,CAAX;AACD,CAZD","file":"ucfirst.js","sourcesContent":["module.exports = function ucfirst (str) {\n // discuss at: http://locutus.io/php/ucfirst/\n // original by: Kevin van Zonneveld (http://kvz.io)\n // bugfixed by: Onno Marsman (https://twitter.com/onnomarsman)\n // improved by: Brett Zamir (http://brett-zamir.me)\n // example 1: ucfirst('kevin van zonneveld')\n // returns 1: 'Kevin van zonneveld'\n\n str += ''\n var f = str.charAt(0)\n .toUpperCase()\n return f + str.substr(1)\n}\n"]}
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/ucwords.js b/node_modules/locutus/php/strings/ucwords.js new file mode 100644 index 0000000..7d76e15 --- /dev/null +++ b/node_modules/locutus/php/strings/ucwords.js @@ -0,0 +1,25 @@ +'use strict'; + +module.exports = function ucwords(str) { + // discuss at: http://locutus.io/php/ucwords/ + // original by: Jonas Raoni Soares Silva (http://www.jsfromhell.com) + // improved by: Waldo Malqui Silva (http://waldo.malqui.info) + // improved by: Robin + // improved by: Kevin van Zonneveld (http://kvz.io) + // bugfixed by: Onno Marsman (https://twitter.com/onnomarsman) + // bugfixed by: Cetvertacov Alexandr (https://github.com/cetver) + // input by: James (http://www.james-bell.co.uk/) + // example 1: ucwords('kevin van zonneveld') + // returns 1: 'Kevin Van Zonneveld' + // example 2: ucwords('HELLO WORLD') + // returns 2: 'HELLO WORLD' + // example 3: ucwords('у мэри был маленький ягненок и она его очень любила') + // returns 3: 'У Мэри Был Маленький Ягненок И Она Его Очень Любила' + // example 4: ucwords('τάχιστη αλώπηξ βαφής ψημένη γη, δρασκελίζει υπέρ νωθρού κυνός') + // returns 4: 'Τάχιστη Αλώπηξ Βαφής Ψημένη Γη, Δρασκελίζει Υπέρ Νωθρού Κυνός' + + return (str + '').replace(/^(.)|\s+(.)/g, function ($1) { + return $1.toUpperCase(); + }); +}; +//# sourceMappingURL=ucwords.js.map
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/ucwords.js.map b/node_modules/locutus/php/strings/ucwords.js.map new file mode 100644 index 0000000..0e34ff0 --- /dev/null +++ b/node_modules/locutus/php/strings/ucwords.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/php/strings/ucwords.js"],"names":["module","exports","ucwords","str","replace","$1","toUpperCase"],"mappings":";;AAAAA,OAAOC,OAAP,GAAiB,SAASC,OAAT,CAAkBC,GAAlB,EAAuB;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAAO,CAACA,MAAM,EAAP,EACJC,OADI,CACI,cADJ,EACoB,UAAUC,EAAV,EAAc;AACrC,WAAOA,GAAGC,WAAH,EAAP;AACD,GAHI,CAAP;AAID,CAtBD","file":"ucwords.js","sourcesContent":["module.exports = function ucwords (str) {\n // discuss at: http://locutus.io/php/ucwords/\n // original by: Jonas Raoni Soares Silva (http://www.jsfromhell.com)\n // improved by: Waldo Malqui Silva (http://waldo.malqui.info)\n // improved by: Robin\n // improved by: Kevin van Zonneveld (http://kvz.io)\n // bugfixed by: Onno Marsman (https://twitter.com/onnomarsman)\n // bugfixed by: Cetvertacov Alexandr (https://github.com/cetver)\n // input by: James (http://www.james-bell.co.uk/)\n // example 1: ucwords('kevin van zonneveld')\n // returns 1: 'Kevin Van Zonneveld'\n // example 2: ucwords('HELLO WORLD')\n // returns 2: 'HELLO WORLD'\n // example 3: ucwords('у мэри был маленький ягненок и она его очень любила')\n // returns 3: 'У Мэри Был Маленький Ягненок И Она Его Очень Любила'\n // example 4: ucwords('τάχιστη αλώπηξ βαφής ψημένη γη, δρασκελίζει υπέρ νωθρού κυνός')\n // returns 4: 'Τάχιστη Αλώπηξ Βαφής Ψημένη Γη, Δρασκελίζει Υπέρ Νωθρού Κυνός'\n\n return (str + '')\n .replace(/^(.)|\\s+(.)/g, function ($1) {\n return $1.toUpperCase()\n })\n}\n"]}
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/vprintf.js b/node_modules/locutus/php/strings/vprintf.js new file mode 100644 index 0000000..52a0b9e --- /dev/null +++ b/node_modules/locutus/php/strings/vprintf.js @@ -0,0 +1,18 @@ +'use strict'; + +module.exports = function vprintf(format, args) { + // discuss at: http://locutus.io/php/vprintf/ + // original by: Ash Searle (http://hexmen.com/blog/) + // improved by: Michael White (http://getsprink.com) + // reimplemented by: Brett Zamir (http://brett-zamir.me) + // example 1: vprintf("%01.2f", 123.1) + // returns 1: 6 + + var sprintf = require('../strings/sprintf'); + var echo = require('../strings/echo'); + var ret = sprintf.apply(this, [format].concat(args)); + echo(ret); + + return ret.length; +}; +//# sourceMappingURL=vprintf.js.map
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/vprintf.js.map b/node_modules/locutus/php/strings/vprintf.js.map new file mode 100644 index 0000000..cf3393d --- /dev/null +++ b/node_modules/locutus/php/strings/vprintf.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/php/strings/vprintf.js"],"names":["module","exports","vprintf","format","args","sprintf","require","echo","ret","apply","concat","length"],"mappings":";;AAAAA,OAAOC,OAAP,GAAiB,SAASC,OAAT,CAAkBC,MAAlB,EAA0BC,IAA1B,EAAgC;AAC/C;AACA;AACA;AACA;AACA;AACA;;AAEA,MAAIC,UAAUC,QAAQ,oBAAR,CAAd;AACA,MAAIC,OAAOD,QAAQ,iBAAR,CAAX;AACA,MAAIE,MAAMH,QAAQI,KAAR,CAAc,IAAd,EAAoB,CAACN,MAAD,EAASO,MAAT,CAAgBN,IAAhB,CAApB,CAAV;AACAG,OAAKC,GAAL;;AAEA,SAAOA,IAAIG,MAAX;AACD,CAdD","file":"vprintf.js","sourcesContent":["module.exports = function vprintf (format, args) {\n // discuss at: http://locutus.io/php/vprintf/\n // original by: Ash Searle (http://hexmen.com/blog/)\n // improved by: Michael White (http://getsprink.com)\n // reimplemented by: Brett Zamir (http://brett-zamir.me)\n // example 1: vprintf(\"%01.2f\", 123.1)\n // returns 1: 6\n\n var sprintf = require('../strings/sprintf')\n var echo = require('../strings/echo')\n var ret = sprintf.apply(this, [format].concat(args))\n echo(ret)\n\n return ret.length\n}\n"]}
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/vsprintf.js b/node_modules/locutus/php/strings/vsprintf.js new file mode 100644 index 0000000..a44af5e --- /dev/null +++ b/node_modules/locutus/php/strings/vsprintf.js @@ -0,0 +1,13 @@ +'use strict'; + +module.exports = function vsprintf(format, args) { + // discuss at: http://locutus.io/php/vsprintf/ + // original by: ejsanders + // example 1: vsprintf('%04d-%02d-%02d', [1988, 8, 1]) + // returns 1: '1988-08-01' + + var sprintf = require('../strings/sprintf'); + + return sprintf.apply(this, [format].concat(args)); +}; +//# sourceMappingURL=vsprintf.js.map
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/vsprintf.js.map b/node_modules/locutus/php/strings/vsprintf.js.map new file mode 100644 index 0000000..d9a4be1 --- /dev/null +++ b/node_modules/locutus/php/strings/vsprintf.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/php/strings/vsprintf.js"],"names":["module","exports","vsprintf","format","args","sprintf","require","apply","concat"],"mappings":";;AAAAA,OAAOC,OAAP,GAAiB,SAASC,QAAT,CAAmBC,MAAnB,EAA2BC,IAA3B,EAAiC;AAChD;AACA;AACA;AACA;;AAEA,MAAIC,UAAUC,QAAQ,oBAAR,CAAd;;AAEA,SAAOD,QAAQE,KAAR,CAAc,IAAd,EAAoB,CAACJ,MAAD,EAASK,MAAT,CAAgBJ,IAAhB,CAApB,CAAP;AACD,CATD","file":"vsprintf.js","sourcesContent":["module.exports = function vsprintf (format, args) {\n // discuss at: http://locutus.io/php/vsprintf/\n // original by: ejsanders\n // example 1: vsprintf('%04d-%02d-%02d', [1988, 8, 1])\n // returns 1: '1988-08-01'\n\n var sprintf = require('../strings/sprintf')\n\n return sprintf.apply(this, [format].concat(args))\n}\n"]}
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/wordwrap.js b/node_modules/locutus/php/strings/wordwrap.js new file mode 100644 index 0000000..b0f4980 --- /dev/null +++ b/node_modules/locutus/php/strings/wordwrap.js @@ -0,0 +1,93 @@ +'use strict'; + +module.exports = function wordwrap(str, intWidth, strBreak, cut) { + // discuss at: http://locutus.io/php/wordwrap/ + // original by: Jonas Raoni Soares Silva (http://www.jsfromhell.com) + // improved by: Nick Callen + // improved by: Kevin van Zonneveld (http://kvz.io) + // improved by: Sakimori + // revised by: Jonas Raoni Soares Silva (http://www.jsfromhell.com) + // bugfixed by: Michael Grier + // bugfixed by: Feras ALHAEK + // improved by: Rafał Kukawski (http://kukawski.net) + // example 1: wordwrap('Kevin van Zonneveld', 6, '|', true) + // returns 1: 'Kevin|van|Zonnev|eld' + // example 2: wordwrap('The quick brown fox jumped over the lazy dog.', 20, '<br />\n') + // returns 2: 'The quick brown fox<br />\njumped over the lazy<br />\ndog.' + // example 3: wordwrap('Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.') + // returns 3: 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod\ntempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim\nveniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea\ncommodo consequat.' + + intWidth = arguments.length >= 2 ? +intWidth : 75; + strBreak = arguments.length >= 3 ? '' + strBreak : '\n'; + cut = arguments.length >= 4 ? !!cut : false; + + var i, j, line; + + str += ''; + + if (intWidth < 1) { + return str; + } + + var reLineBreaks = /\r\n|\n|\r/; + var reBeginningUntilFirstWhitespace = /^\S*/; + var reLastCharsWithOptionalTrailingWhitespace = /\S*(\s)?$/; + + var lines = str.split(reLineBreaks); + var l = lines.length; + var match; + + // for each line of text + for (i = 0; i < l; lines[i++] += line) { + line = lines[i]; + lines[i] = ''; + + while (line.length > intWidth) { + // get slice of length one char above limit + var slice = line.slice(0, intWidth + 1); + + // remove leading whitespace from rest of line to parse + var ltrim = 0; + // remove trailing whitespace from new line content + var rtrim = 0; + + match = slice.match(reLastCharsWithOptionalTrailingWhitespace); + + // if the slice ends with whitespace + if (match[1]) { + // then perfect moment to cut the line + j = intWidth; + ltrim = 1; + } else { + // otherwise cut at previous whitespace + j = slice.length - match[0].length; + + if (j) { + rtrim = 1; + } + + // but if there is no previous whitespace + // and cut is forced + // cut just at the defined limit + if (!j && cut && intWidth) { + j = intWidth; + } + + // if cut wasn't forced + // cut at next possible whitespace after the limit + if (!j) { + var charsUntilNextWhitespace = (line.slice(intWidth).match(reBeginningUntilFirstWhitespace) || [''])[0]; + + j = slice.length + charsUntilNextWhitespace.length; + } + } + + lines[i] += line.slice(0, j - rtrim); + line = line.slice(j + ltrim); + lines[i] += line.length ? strBreak : ''; + } + } + + return lines.join('\n'); +}; +//# sourceMappingURL=wordwrap.js.map
\ No newline at end of file diff --git a/node_modules/locutus/php/strings/wordwrap.js.map b/node_modules/locutus/php/strings/wordwrap.js.map new file mode 100644 index 0000000..936fe1f --- /dev/null +++ b/node_modules/locutus/php/strings/wordwrap.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/php/strings/wordwrap.js"],"names":["module","exports","wordwrap","str","intWidth","strBreak","cut","arguments","length","i","j","line","reLineBreaks","reBeginningUntilFirstWhitespace","reLastCharsWithOptionalTrailingWhitespace","lines","split","l","match","slice","ltrim","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AR,YAAIN,QAAJ;AACAgB,gBAAQ,CAAR;AACD,OAJD,MAIO;AACL;AACAV,YAAIS,MAAMX,MAAN,GAAeU,MAAM,CAAN,EAASV,MAA5B;;AAEA,YAAIE,CAAJ,EAAO;AACLW,kBAAQ,CAAR;AACD;;AAED;AACA;AACA;AACA,YAAI,CAACX,CAAD,IAAMJ,GAAN,IAAaF,QAAjB,EAA2B;AACzBM,cAAIN,QAAJ;AACD;;AAED;AACA;AACA,YAAI,CAACM,CAAL,EAAQ;AACN,cAAIY,2BAA2B,CAACX,KAAKQ,KAAL,CAAWf,QAAX,EAAqBc,KAArB,CAA2BL,+BAA3B,KAA+D,CAAC,EAAD,CAAhE,EAAsE,CAAtE,CAA/B;;AAEAH,cAAIS,MAAMX,MAAN,GAAec,yBAAyBd,MAA5C;AACD;AACF;;AAEDO,YAAMN,CAAN,KAAYE,KAAKQ,KAAL,CAAW,CAAX,EAAcT,IAAIW,KAAlB,CAAZ;AACAV,aAAOA,KAAKQ,KAAL,CAAWT,IAAIU,KAAf,CAAP;AACAL,YAAMN,CAAN,KAAYE,KAAKH,MAAL,GAAcH,QAAd,GAAyB,EAArC;AACD;AACF;;AAED,SAAOU,MAAMQ,IAAN,CAAW,IAAX,CAAP;AACD,CAzFD","file":"wordwrap.js","sourcesContent":["module.exports = function wordwrap (str, intWidth, strBreak, cut) {\n // discuss at: http://locutus.io/php/wordwrap/\n // original by: Jonas Raoni Soares Silva (http://www.jsfromhell.com)\n // improved by: Nick Callen\n // improved by: Kevin van Zonneveld (http://kvz.io)\n // improved by: Sakimori\n // revised by: Jonas Raoni Soares Silva (http://www.jsfromhell.com)\n // bugfixed by: Michael Grier\n // bugfixed by: Feras ALHAEK\n // improved by: Rafał Kukawski (http://kukawski.net)\n // example 1: wordwrap('Kevin van Zonneveld', 6, '|', true)\n // returns 1: 'Kevin|van|Zonnev|eld'\n // example 2: wordwrap('The quick brown fox jumped over the lazy dog.', 20, '<br />\\n')\n // returns 2: 'The quick brown fox<br />\\njumped over the lazy<br />\\ndog.'\n // example 3: wordwrap('Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.')\n // returns 3: 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod\\ntempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim\\nveniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea\\ncommodo consequat.'\n\n intWidth = arguments.length >= 2 ? +intWidth : 75\n strBreak = arguments.length >= 3 ? '' + strBreak : '\\n'\n cut = arguments.length >= 4 ? !!cut : false\n\n var i, j, line\n\n str += ''\n\n if (intWidth < 1) {\n return str\n }\n\n var reLineBreaks = /\\r\\n|\\n|\\r/\n var reBeginningUntilFirstWhitespace = /^\\S*/\n var reLastCharsWithOptionalTrailingWhitespace = /\\S*(\\s)?$/\n\n var lines = str.split(reLineBreaks)\n var l = lines.length\n var match\n\n // for each line of text\n for (i = 0; i < l; lines[i++] += line) {\n line = lines[i]\n lines[i] = ''\n\n while (line.length > intWidth) {\n // get slice of length one char above limit\n var slice = line.slice(0, intWidth + 1)\n\n // remove leading whitespace from rest of line to parse\n var ltrim = 0\n // remove trailing whitespace from new line content\n var rtrim = 0\n\n match = slice.match(reLastCharsWithOptionalTrailingWhitespace)\n\n // if the slice ends with whitespace\n if (match[1]) {\n // then perfect moment to cut the line\n j = intWidth\n ltrim = 1\n } else {\n // otherwise cut at previous whitespace\n j = slice.length - match[0].length\n\n if (j) {\n rtrim = 1\n }\n\n // but if there is no previous whitespace\n // and cut is forced\n // cut just at the defined limit\n if (!j && cut && intWidth) {\n j = intWidth\n }\n\n // if cut wasn't forced\n // cut at next possible whitespace after the limit\n if (!j) {\n var charsUntilNextWhitespace = (line.slice(intWidth).match(reBeginningUntilFirstWhitespace) || [''])[0]\n\n j = slice.length + charsUntilNextWhitespace.length\n }\n }\n\n lines[i] += line.slice(0, j - rtrim)\n line = line.slice(j + ltrim)\n lines[i] += line.length ? strBreak : ''\n }\n }\n\n return lines.join('\\n')\n}\n"]}
\ No newline at end of file |