mirror of
https://github.com/idanoo/GoScrobble.git
synced 2024-11-24 09:25:15 +00:00
1 line
5.7 KiB
JSON
1 line
5.7 KiB
JSON
{"ast":null,"code":"'use strict';\n\nvar utils = require('./../utils');\n\nfunction encode(val) {\n return encodeURIComponent(val).replace(/%3A/gi, ':').replace(/%24/g, '$').replace(/%2C/gi, ',').replace(/%20/g, '+').replace(/%5B/gi, '[').replace(/%5D/gi, ']');\n}\n/**\n * Build a URL by appending params to the end\n *\n * @param {string} url The base of the url (e.g., http://www.google.com)\n * @param {object} [params] The params to be appended\n * @returns {string} The formatted url\n */\n\n\nmodule.exports = function buildURL(url, params, paramsSerializer) {\n /*eslint no-param-reassign:0*/\n if (!params) {\n return url;\n }\n\n var serializedParams;\n\n if (paramsSerializer) {\n serializedParams = paramsSerializer(params);\n } else if (utils.isURLSearchParams(params)) {\n serializedParams = params.toString();\n } else {\n var parts = [];\n utils.forEach(params, function serialize(val, key) {\n if (val === null || typeof val === 'undefined') {\n return;\n }\n\n if (utils.isArray(val)) {\n key = key + '[]';\n } else {\n val = [val];\n }\n\n utils.forEach(val, function parseValue(v) {\n if (utils.isDate(v)) {\n v = v.toISOString();\n } else if (utils.isObject(v)) {\n v = JSON.stringify(v);\n }\n\n parts.push(encode(key) + '=' + encode(v));\n });\n });\n serializedParams = parts.join('&');\n }\n\n if (serializedParams) {\n var hashmarkIndex = url.indexOf('#');\n\n if (hashmarkIndex !== -1) {\n url = url.slice(0, hashmarkIndex);\n }\n\n url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;\n }\n\n return url;\n};","map":{"version":3,"sources":["/app/node_modules/axios/lib/helpers/buildURL.js"],"names":["utils","require","encode","val","encodeURIComponent","replace","module","exports","buildURL","url","params","paramsSerializer","serializedParams","isURLSearchParams","toString","parts","forEach","serialize","key","isArray","parseValue","v","isDate","toISOString","isObject","JSON","stringify","push","join","hashmarkIndex","indexOf","slice"],"mappings":"AAAA;;AAEA,IAAIA,KAAK,GAAGC,OAAO,CAAC,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BC,CAApB,EAAuB;AACxC,YAAIrB,KAAK,CAACsB,MAAN,CAAaD,CAAb,CAAJ,EAAqB;AACnBA,UAAAA,CAAC,GAAGA,CAAC,CAACE,WAAF,EAAJ;AACD,SAFD,MAEO,IAAIvB,KAAK,CAACwB,QAAN,CAAeH,CAAf,CAAJ,EAAuB;AAC5BA,UAAAA,CAAC,GAAGI,IAAI,CAACC,SAAL,CAAeL,CAAf,CAAJ;AACD;;AACDN,QAAAA,KAAK,CAACY,IAAN,CAAWzB,MAAM,CAACgB,GAAD,CAAN,GAAc,GAAd,GAAoBhB,MAAM,CAACmB,CAAD,CAArC;AACD,OAPD;AAQD,KAnBD;AAqBAT,IAAAA,gBAAgB,GAAGG,KAAK,CAACa,IAAN,CAAW,GAAX,CAAnB;AACD;;AAED,MAAIhB,gBAAJ,EAAsB;AACpB,QAAIiB,aAAa,GAAGpB,GAAG,CAACqB,OAAJ,CAAY,GAAZ,CAApB;;AACA,QAAID,aAAa,KAAK,CAAC,CAAvB,EAA0B;AACxBpB,MAAAA,GAAG,GAAGA,GAAG,CAACsB,KAAJ,CAAU,CAAV,EAAaF,aAAb,CAAN;AACD;;AAEDpB,IAAAA,GAAG,IAAI,CAACA,GAAG,CAACqB,OAAJ,CAAY,GAAZ,MAAqB,CAAC,CAAtB,GAA0B,GAA1B,GAAgC,GAAjC,IAAwClB,gBAA/C;AACD;;AAED,SAAOH,GAAP;AACD,CAhDD","sourcesContent":["'use strict';\n\nvar utils = require('./../utils');\n\nfunction encode(val) {\n return encodeURIComponent(val).\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, '+').\n replace(/%5B/gi, '[').\n replace(/%5D/gi, ']');\n}\n\n/**\n * Build a URL by appending params to the end\n *\n * @param {string} url The base of the url (e.g., http://www.google.com)\n * @param {object} [params] The params to be appended\n * @returns {string} The formatted url\n */\nmodule.exports = function buildURL(url, params, paramsSerializer) {\n /*eslint no-param-reassign:0*/\n if (!params) {\n return url;\n }\n\n var serializedParams;\n if (paramsSerializer) {\n serializedParams = paramsSerializer(params);\n } else if (utils.isURLSearchParams(params)) {\n serializedParams = params.toString();\n } else {\n var parts = [];\n\n utils.forEach(params, function serialize(val, key) {\n if (val === null || typeof val === 'undefined') {\n return;\n }\n\n if (utils.isArray(val)) {\n key = key + '[]';\n } else {\n val = [val];\n }\n\n utils.forEach(val, function parseValue(v) {\n if (utils.isDate(v)) {\n v = v.toISOString();\n } else if (utils.isObject(v)) {\n v = JSON.stringify(v);\n }\n parts.push(encode(key) + '=' + encode(v));\n });\n });\n\n serializedParams = parts.join('&');\n }\n\n if (serializedParams) {\n var hashmarkIndex = url.indexOf('#');\n if (hashmarkIndex !== -1) {\n url = url.slice(0, hashmarkIndex);\n }\n\n url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;\n }\n\n return url;\n};\n"]},"metadata":{},"sourceType":"script"} |