mirror of
https://github.com/idanoo/GoScrobble.git
synced 2024-11-24 09:25:15 +00:00
1 line
7.5 KiB
JSON
1 line
7.5 KiB
JSON
|
{"ast":null,"code":"// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n'use strict'; // If obj.hasOwnProperty has been overridden, then calling\n// obj.hasOwnProperty(prop) will break.\n// See: https://github.com/joyent/node/issues/1707\n\nfunction hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}\n\nmodule.exports = function (qs, sep, eq, options) {\n sep = sep || '&';\n eq = eq || '=';\n var obj = {};\n\n if (typeof qs !== 'string' || qs.length === 0) {\n return obj;\n }\n\n var regexp = /\\+/g;\n qs = qs.split(sep);\n var maxKeys = 1000;\n\n if (options && typeof options.maxKeys === 'number') {\n maxKeys = options.maxKeys;\n }\n\n var len = qs.length; // maxKeys <= 0 means that we should not limit keys count\n\n if (maxKeys > 0 && len > maxKeys) {\n len = maxKeys;\n }\n\n for (var i = 0; i < len; ++i) {\n var x = qs[i].replace(regexp, '%20'),\n idx = x.indexOf(eq),\n kstr,\n vstr,\n k,\n v;\n\n if (idx >= 0) {\n kstr = x.substr(0, idx);\n vstr = x.substr(idx + 1);\n } else {\n kstr = x;\n vstr = '';\n }\n\n k = decodeURIComponent(kstr);\n v = decodeURIComponent(vstr);\n\n if (!hasOwnProperty(obj, k)) {\n obj[k] = v;\n } else if (isArray(obj[k])) {\n obj[k].push(v);\n } else {\n obj[k] = [obj[k], v];\n }\n }\n\n return obj;\n};\n\nvar isArray = Array.isArray || function (xs) {\n return Object.prototype.toString.call(xs) === '[object Array]';\n};","map":{"version":3,"sources":["/app/node_modules/querystring-es3/decode.js"],"names":["hasOwnProperty","obj","prop","Object","prototype","call","module","exports","qs","sep","eq","options","length","regexp","split","maxKeys","len","i","x","replace","idx","indexOf","kstr","vstr","k","v","substr","decodeURIComponent","isArray","push","Array","xs","toString"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA,a,CAEA;AACA;AACA;;AACA,SAASA,cAAT,CAAwBC,GAAxB,EAA6BC,IAA7B,EAAmC;AACjC,SAAOC,MAAM,CAACC,SAAP,CAAiBJ,cAAjB,CAAgCK,IAAhC,CAAqCJ,GAArC,EAA0CC,IAA1C,CAAP;AACD;;AAEDI,MAAM,CAACC,OAAP,GAAiB,UAASC,EAAT,EAAaC,GAAb,EAAkBC,EAAlB,EAAsBC,OAAtB,EAA+B;AAC9CF,EAAAA,GAAG,GAAGA,GAAG,IAAI,GAAb;AACAC,EAAAA,EAAE,GAAGA,EAAE,IAAI,GAAX;AACA,MAAIT,GAAG,GAAG,EAAV;;AAEA,MAAI,OAAOO,EAAP,KAAc,QAAd,IAA0BA,EAAE,CAACI,MAAH,KAAc,CAA5C,EAA+C;AAC7C,WAAOX,GAAP;AACD;;AAED,MAAIY,MAAM,GAAG,KAAb;AACAL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