From 824a2d9f587ca017fc71b84d835e72f54f9c87c4 Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Wed, 7 Nov 2018 18:02:36 +0100 Subject: Began rewrite --- node_modules/locutus/php/var/unserialize.js.map | 1 + 1 file changed, 1 insertion(+) create mode 100644 node_modules/locutus/php/var/unserialize.js.map (limited to 'node_modules/locutus/php/var/unserialize.js.map') diff --git a/node_modules/locutus/php/var/unserialize.js.map b/node_modules/locutus/php/var/unserialize.js.map new file mode 100644 index 0000000..dbf9160 --- /dev/null +++ b/node_modules/locutus/php/var/unserialize.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/php/var/unserialize.js"],"names":["module","exports","unserialize","data","$global","window","global","utf8Overhead","str","s","length","i","code","charCodeAt","error","type","msg","filename","line","readUntil","offset","stopchr","buf","chr","slice","push","join","readChrs","_unserialize","dtype","dataoffset","keyandchrs","keys","contig","array","readdata","readData","ccount","stringlength","key","kprops","kchrs","vprops","vchrs","value","chrs","typeconvert","x","toLowerCase","parseInt","parseFloat","Array"],"mappings":";;AAAAA,OAAOC,OAAP,GAAiB,SAASC,WAAT,CAAsBC,IAAtB,EAA4B;AAC3C;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,UAAW,OAAOC,MAAP,KAAkB,WAAlB,GAAgCA,MAAhC,GAAyCC,MAAxD;;AAEA,MAAIC,eAAe,SAAfA,YAAe,CAAUC,GAAV,EAAe;AAChC,QAAIC,IAAID,IAAIE,MAAZ;AACA,SAAK,IAAIC,IAAIH,IAAIE,MAAJ,GAAa,CAA1B,EAA6BC,KAAK,CAAlC,EAAqCA,GAArC,EAA0C;AACxC,UAAIC,OAAOJ,IAAIK,UAAJ,CAAeF,CAAf,CAAX;AACA,UAAIC,OAAO,IAAP,IAAeA,QAAQ,KAA3B,EAAkC;AAChCH;AACD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,SAASjB,IAAT,EAAe,EAAf,CAAT;AACAC,iBAAS,IAAT;;AAEA,aAAKtB,IAAI,CAAT,EAAYA,IAAID,MAAhB,EAAwBC,GAAxB,EAA6B;AAC3B6B,mBAASZ,aAAazB,IAAb,EAAmB2B,UAAnB,CAAT;AACAW,kBAAQD,OAAO,CAAP,CAAR;AACAD,gBAAMC,OAAO,CAAP,CAAN;AACAV,wBAAcW,KAAd;;AAEAC,mBAASd,aAAazB,IAAb,EAAmB2B,UAAnB,CAAT;AACAa,kBAAQD,OAAO,CAAP,CAAR;AACAE,kBAAQF,OAAO,CAAP,CAAR;AACAZ,wBAAca,KAAd;;AAEA,cAAIJ,QAAQ5B,CAAZ,EAAe;AACbsB,qBAAS,KAAT;AACD;;AAEDE,mBAASI,GAAT,IAAgBK,KAAhB;AACD;;AAED,YAAIX,MAAJ,EAAY;AACVC,kBAAQ,IAAIiB,KAAJ,CAAUzC,MAAV,CAAR;AACA,eAAKC,IAAI,CAAT,EAAYA,IAAID,MAAhB,EAAwBC,GAAxB,EAA6B;AAC3BuB,kBAAMvB,CAAN,IAAWwB,SAASxB,CAAT,CAAX;AACD;AACDwB,qBAAWD,KAAX;AACD;;AAEDJ,sBAAc,CAAd;AACA;AACF;AACEhB,cAAM,aAAN,EAAqB,uCAAuCe,KAA5D;AACA;AAtFJ;AAwFA,WAAO,CAACA,KAAD,EAAQC,aAAaV,MAArB,EAA6B0B,YAAYX,QAAZ,CAA7B,CAAP;AACD;;AAED,SAAOP,aAAczB,OAAO,EAArB,EAA0B,CAA1B,EAA6B,CAA7B,CAAP;AACD,CAzMD","file":"unserialize.js","sourcesContent":["module.exports = function unserialize (data) {\n // discuss at: http://locutus.io/php/unserialize/\n // original by: Arpad Ray (mailto:arpad@php.net)\n // improved by: Pedro Tainha (http://www.pedrotainha.com)\n // improved by: Kevin van Zonneveld (http://kvz.io)\n // improved by: Kevin van Zonneveld (http://kvz.io)\n // improved by: Chris\n // improved by: James\n // improved by: Le Torbi\n // improved by: Eli Skeggs\n // bugfixed by: dptr1988\n // bugfixed by: Kevin van Zonneveld (http://kvz.io)\n // bugfixed by: Brett Zamir (http://brett-zamir.me)\n // bugfixed by: philippsimon (https://github.com/philippsimon/)\n // revised by: d3x\n // input by: Brett Zamir (http://brett-zamir.me)\n // input by: Martin (http://www.erlenwiese.de/)\n // input by: kilops\n // input by: Jaroslaw Czarniak\n // input by: lovasoa (https://github.com/lovasoa/)\n // note 1: We feel the main purpose of this function should be\n // note 1: to ease the transport of data between php & js\n // note 1: Aiming for PHP-compatibility, we have to translate objects to arrays\n // example 1: unserialize('a:3:{i:0;s:5:\"Kevin\";i:1;s:3:\"van\";i:2;s:9:\"Zonneveld\";}')\n // returns 1: ['Kevin', 'van', 'Zonneveld']\n // example 2: unserialize('a:2:{s:9:\"firstName\";s:5:\"Kevin\";s:7:\"midName\";s:3:\"van\";}')\n // returns 2: {firstName: 'Kevin', midName: 'van'}\n // example 3: unserialize('a:3:{s:2:\"ü\";s:2:\"ü\";s:3:\"四\";s:3:\"四\";s:4:\"𠜎\";s:4:\"𠜎\";}')\n // returns 3: {'ü': 'ü', '四': '四', '𠜎': '𠜎'}\n\n var $global = (typeof window !== 'undefined' ? window : global)\n\n var utf8Overhead = function (str) {\n var s = str.length\n for (var i = str.length - 1; i >= 0; i--) {\n var code = str.charCodeAt(i)\n if (code > 0x7f && code <= 0x7ff) {\n s++\n } else if (code > 0x7ff && code <= 0xffff) {\n s += 2\n }\n // trail surrogate\n if (code >= 0xDC00 && code <= 0xDFFF) {\n i--\n }\n }\n return s - 1\n }\n var error = function (type,\n msg, filename, line) {\n throw new $global[type](msg, filename, line)\n }\n var readUntil = function (data, offset, stopchr) {\n var i = 2\n var buf = []\n var chr = data.slice(offset, offset + 1)\n\n while (chr !== stopchr) {\n if ((i + offset) > data.length) {\n error('Error', 'Invalid')\n }\n buf.push(chr)\n chr = data.slice(offset + (i - 1), offset + i)\n i += 1\n }\n return [buf.length, buf.join('')]\n }\n var readChrs = function (data, offset, length) {\n var i, chr, buf\n\n buf = []\n for (i = 0; i < length; i++) {\n chr = data.slice(offset + (i - 1), offset + i)\n buf.push(chr)\n length -= utf8Overhead(chr)\n }\n return [buf.length, buf.join('')]\n }\n function _unserialize (data, offset) {\n var dtype\n var dataoffset\n var keyandchrs\n var keys\n var contig\n var length\n var array\n var readdata\n var readData\n var ccount\n var stringlength\n var i\n var key\n var kprops\n var kchrs\n var vprops\n var vchrs\n var value\n var chrs = 0\n var typeconvert = function (x) {\n return x\n }\n\n if (!offset) {\n offset = 0\n }\n dtype = (data.slice(offset, offset + 1)).toLowerCase()\n\n dataoffset = offset + 2\n\n switch (dtype) {\n case 'i':\n typeconvert = function (x) {\n return parseInt(x, 10)\n }\n readData = readUntil(data, dataoffset, ';')\n chrs = readData[0]\n readdata = readData[1]\n dataoffset += chrs + 1\n break\n case 'b':\n typeconvert = function (x) {\n return parseInt(x, 10) !== 0\n }\n readData = readUntil(data, dataoffset, ';')\n chrs = readData[0]\n readdata = readData[1]\n dataoffset += chrs + 1\n break\n case 'd':\n typeconvert = function (x) {\n return parseFloat(x)\n }\n readData = readUntil(data, dataoffset, ';')\n chrs = readData[0]\n readdata = readData[1]\n dataoffset += chrs + 1\n break\n case 'n':\n readdata = null\n break\n case 's':\n ccount = readUntil(data, dataoffset, ':')\n chrs = ccount[0]\n stringlength = ccount[1]\n dataoffset += chrs + 2\n\n readData = readChrs(data, dataoffset + 1, parseInt(stringlength, 10))\n chrs = readData[0]\n readdata = readData[1]\n dataoffset += chrs + 2\n if (chrs !== parseInt(stringlength, 10) && chrs !== readdata.length) {\n error('SyntaxError', 'String length mismatch')\n }\n break\n case 'a':\n readdata = {}\n\n keyandchrs = readUntil(data, dataoffset, ':')\n chrs = keyandchrs[0]\n keys = keyandchrs[1]\n dataoffset += chrs + 2\n\n length = parseInt(keys, 10)\n contig = true\n\n for (i = 0; i < length; i++) {\n kprops = _unserialize(data, dataoffset)\n kchrs = kprops[1]\n key = kprops[2]\n dataoffset += kchrs\n\n vprops = _unserialize(data, dataoffset)\n vchrs = vprops[1]\n value = vprops[2]\n dataoffset += vchrs\n\n if (key !== i) {\n contig = false\n }\n\n readdata[key] = value\n }\n\n if (contig) {\n array = new Array(length)\n for (i = 0; i < length; i++) {\n array[i] = readdata[i]\n }\n readdata = array\n }\n\n dataoffset += 1\n break\n default:\n error('SyntaxError', 'Unknown / Unhandled data type(s): ' + dtype)\n break\n }\n return [dtype, dataoffset - offset, typeconvert(readdata)]\n }\n\n return _unserialize((data + ''), 0)[2]\n}\n"]} \ No newline at end of file -- cgit v1.2.3