You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 line
7.6 KiB
1 line
7.6 KiB
4 years ago
|
{"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';\n\nvar stringifyPrimitive = function (v) {\n switch (typeof v) {\n case 'string':\n return v;\n\n case 'boolean':\n return v ? 'true' : 'false';\n\n case 'number':\n return isFinite(v) ? v : '';\n\n default:\n return '';\n }\n};\n\nmodule.exports = function (obj, sep, eq, name) {\n sep = sep || '&';\n eq = eq || '=';\n\n if (obj === null) {\n obj = undefined;\n }\n\n if (typeof obj === 'object') {\n return map(objectKeys(obj), function (k) {\n var ks = encodeURIComponent(stringifyPrimitive(k)) + eq;\n\n if (isArray(obj[k])) {\n return map(obj[k], function (v) {\n return ks + encodeURIComponent(stringifyPrimitive(v));\n }).join(sep);\n } else {\n return ks + encodeURIComponent(stringifyPrimitive(obj[k]));\n }\n }).join(sep);\n }\n\n if (!name) return '';\n return encodeURIComponent(stringifyPrimitive(name)) + eq + encodeURIComponent(stringifyPrimitive(obj));\n};\n\nvar isArray = Array.isArray || function (xs) {\n return Object.prototype.toString.call(xs) === '[object Array]';\n};\n\nfunction map(xs, f) {\n if (xs.map) return xs.map(f);\n var res = [];\n\n for (var i = 0; i < xs.length; i++) {\n res.push(f(xs[i], i));\n }\n\n return res;\n}\n\nvar objectKeys = Object.keys || function (obj) {\n var res = [];\n\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) res.push(key);\n }\n\n return res;\n};","map":{"version":3,"sources":["C:/Users/user/Documents/myapp/node_modules/querystring-es3/encode.js"],"names":["stringifyPrimitive","v","isFinite","module","exports","obj","sep","eq","name","undefined","map","objectKeys","k","ks","encodeURIComponent","isArray","join","Array","xs","Object","prototype","toString","call","f","res","i","length","push","keys","key","hasOwnProperty"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;;AAEA,IAAIA,kBAAkB,GAAG,UAASC,CAAT,EAAY;AACnC,UAAQ,OAAOA,CAAf;AACE,SAAK,QAAL;AACE,aAAOA,CAAP;;AAEF,SAAK,SAAL;AACE,aAAOA,CAAC,GAAG,MAAH,GAAY,OAApB;;AAEF,SAAK,QAAL;AACE,aAAOC,QAAQ,CAACD,CAAD,CAAR,GAAcA,CAAd,GAAkB,EAAzB;;AAEF;AACE,aAAO,EAAP;AAXJ;AAaD,CAdD;;AAgBAE,MAAM,CAACC,OAAP,GAAiB,UAASC,GAAT,EAAcC,GAAd,EAAmBC,EAAnB,EAAuBC,IAAvB,EAA6B;AAC5CF,EAAAA,GAAG,GAAGA,GAAG,IAAI,GAAb;AACAC,EAAAA,EAAE,GAAGA,EAAE,IAAI,GAAX;;AACA,MAAIF,GAAG,KAAK,IAAZ,EAAkB;AAChBA,IAAAA,GAAG,GAAGI,SAAN;AACD;;AAED,MAAI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