GoScrobble/web/node_modules/.cache/babel-loader/fd46a966a7343b7f73f7eeeb55794fd9.json

1 line
8.8 KiB
JSON
Raw Permalink Normal View History

2022-04-25 02:47:15 +00:00
{"ast":null,"code":"'use strict';\n\nvar utils = require('./../utils');\n\nvar buildURL = require('../helpers/buildURL');\n\nvar InterceptorManager = require('./InterceptorManager');\n\nvar dispatchRequest = require('./dispatchRequest');\n\nvar mergeConfig = require('./mergeConfig');\n/**\n * Create a new instance of Axios\n *\n * @param {Object} instanceConfig The default config for the instance\n */\n\n\nfunction Axios(instanceConfig) {\n this.defaults = instanceConfig;\n this.interceptors = {\n request: new InterceptorManager(),\n response: new InterceptorManager()\n };\n}\n/**\n * Dispatch a request\n *\n * @param {Object} config The config specific for this request (merged with this.defaults)\n */\n\n\nAxios.prototype.request = function request(config) {\n /*eslint no-param-reassign:0*/\n // Allow for axios('example/url'[, config]) a la fetch API\n if (typeof config === 'string') {\n config = arguments[1] || {};\n config.url = arguments[0];\n } else {\n config = config || {};\n }\n\n config = mergeConfig(this.defaults, config); // Set config.method\n\n if (config.method) {\n config.method = config.method.toLowerCase();\n } else if (this.defaults.method) {\n config.method = this.defaults.method.toLowerCase();\n } else {\n config.method = 'get';\n } // Hook up interceptors middleware\n\n\n var chain = [dispatchRequest, undefined];\n var promise = Promise.resolve(config);\n this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {\n chain.unshift(interceptor.fulfilled, interceptor.rejected);\n });\n this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {\n chain.push(interceptor.fulfilled, interceptor.rejected);\n });\n\n while (chain.length) {\n promise = promise.then(chain.shift(), chain.shift());\n }\n\n return promise;\n};\n\nAxios.prototype.getUri = function getUri(config) {\n config = mergeConfig(this.defaults, config);\n return buildURL(config.url, config.params, config.paramsSerializer).replace(/^\\?/, '');\n}; // Provide aliases for supported request methods\n\n\nutils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function (url, config) {\n return this.request(mergeConfig(config || {}, {\n method: method,\n url: url,\n data: (config || {}).data\n }));\n };\n});\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function (url, data, config) {\n return this.request(mergeConfig(config || {}, {\n method: method,\n url: url,\n data: data\n }));\n };\n});\nmodule.exports = Axios;","map":{"version":3,"sources":["/app/node_modules/axios/lib/core/Axios.js"],"names":["utils","require","buildURL","InterceptorManager","dispatchRequest","mergeConfig","Axios","instanceConfig","defaults","interceptors","request","response","prototype","config","arguments","url","method","toLowerCase","chain","undefined","promise","Promise","resolve","forEach","unshiftRequestInterceptors","interceptor","unshift","fulfilled","rejected","pushResponseInterceptors","push","length","then","shift","getUri","params","paramsSerializer","replace","forEachMethodNoData","data","forEachMethodWithData","module","exports"],"mappings":"AAAA;;AAEA,IAAIA,KAAK,GAAGC,OAAO,CAAC,YAAD,CAAnB;;AACA,IAAIC,QAAQ,GAAGD,OAAO,CAAC,qBAAD,CAAtB;;AACA,IAAIE,kBAAkB,GAAGF,OAAO,CAAC,sBAAD,CAAhC;;AACA,IAAIG,eAAe,GAAGH,OAAO,CAAC,mBAAD,CAA7B;;AACA,IAAII,WAAW,GAAGJ,OAAO,CAAC,eAAD,CAAzB;AAEA;AACA;AACA;AACA;AACA;;;AACA,SAASK,KAAT,CAAeC,cAAf,EAA+B;AAC7B,OAAKC,QAAL,GAAgBD,cAAhB;AACA,OAAKE,YAAL,GAAoB;AAClBC,IAAAA,OAAO,EAAE,IAAIP,kBAAJ,EADS;AAElBQ,IAAAA,QAAQ,EAAE,IAAIR,kBAAJ;AAFQ,GAApB;AAID;AAED;AACA;AACA;AACA;AACA;;;AACAG,KAAK,CAACM,SAAN,CAAgBF,OAAhB,GAA0B,SAASA,OAAT,CAAiBG,MAAjB,EAAyB;AACjD;AACA;AACA,MAAI,OAAOA,MAAP,KAAkB,QAAtB,EAAgC;AAC9BA,IAAAA,MAAM,GAAGC,SAAS,CAAC,CAAD,CAAT,IAAgB,EAAzB;AACAD,IAAAA,MAAM,CAACE,GAAP,GAAaD,SAAS,CAAC,CAAD,CAAtB;AACD,GAHD,