Download coderank/units/axios.jsonl from paintedwolfcode/bialy-dataset: direct link, hf CLI and curl.
- Browser
- Download file 455 kB
-
https://huggingface.co/datasets/paintedwolfcode/bialy-dataset/resolve/main/coderank/units/axios.jsonl
- Command line
-
hf download hf://datasets/paintedwolfcode/bialy-dataset/coderank/units/axios.jsonl
-
curl -L -o axios.jsonl https://huggingface.co/datasets/paintedwolfcode/bialy-dataset/resolve/main/coderank/units/axios.jsonl
455 kB
| {"repo":"axios","file":"docs/.vitepress/config.mts","line":8,"symbol":"enNav","kind":"constant","lang":"typescript","code":"const enNav = [\n { text: 'Guide', link: '/pages/getting-started/first-steps' },\n { text: 'API', link: '/pages/advanced/api-reference' },\n { text: 'Sponsors', link: '/pages/misc/sponsors' },\n { text: 'v1.x', link: '#' },\n];"} | |
| {"repo":"axios","file":"docs/.vitepress/config.mts","line":15,"symbol":"enSidebar","kind":"constant","lang":"typescript","code":"const enSidebar = [\n {\n text: 'Getting Started',\n items: [\n { text: 'First steps', link: '/pages/getting-started/first-steps' },\n { text: 'Features', link: '/pages/getting-started/features' },\n {\n text: 'Examples',\n items: [\n { text: 'JavaScript', link: '/pages/getting-started/examples/commonjs' },\n { text: 'TypeScript', link: '/pages/getting-started/examples/typescript' },\n ],\n },\n { text: 'Upgrade guide v0.x -> v1.x', link: '/pages/getting-started/upgrade-guide' },\n ],\n },\n {\n text: 'Advanced',\n items: [\n { text: 'Public API', link: '/pages/advanced/api-reference' },\n { text: 'Request method aliases', link: '/pages/advanced/request-method-aliases' },\n { text: 'Creating an instance', link: '/pages/advanced/create-an-instance' },\n { text: 'Request config', link: '/pages/advanced/request-config' },\n { text: 'Adapters', link: '/pages/advanced/adapters' },\n { text: 'Response schema', link: '/pages/advanced/response-schema' },\n { text: 'Config defaults', link: '/pages/advanced/config-defaults' },\n { text: 'Interceptors', link: '/pages/advanced/interceptors' },\n "} | |
| {"repo":"axios","file":"docs/.vitepress/config.mts","line":80,"symbol":"zhNav","kind":"constant","lang":"typescript","code":"const zhNav = [\n { text: '指南', link: '/zh/pages/getting-started/first-steps' },\n { text: 'API', link: '/zh/pages/advanced/api-reference' },\n { text: '赞助商', link: '/zh/pages/misc/sponsors' },\n { text: 'v1.x', link: '#' },\n];"} | |
| {"repo":"axios","file":"docs/.vitepress/config.mts","line":87,"symbol":"zhSidebar","kind":"constant","lang":"typescript","code":"const zhSidebar = [\n {\n text: '入门指南',\n items: [\n { text: '第一步', link: '/zh/pages/getting-started/first-steps' },\n { text: '功能特性', link: '/zh/pages/getting-started/features' },\n {\n text: '示例',\n items: [\n { text: 'JavaScript', link: '/zh/pages/getting-started/examples/commonjs' },\n { text: 'TypeScript', link: '/zh/pages/getting-started/examples/typescript' },\n ],\n },\n { text: '升级指南 v0.x -> v1.x', link: '/zh/pages/getting-started/upgrade-guide' },\n ],\n },\n {\n text: '进阶',\n items: [\n { text: '公共 API', link: '/zh/pages/advanced/api-reference' },\n { text: '请求方法别名', link: '/zh/pages/advanced/request-method-aliases' },\n { text: '创建实例', link: '/zh/pages/advanced/create-an-instance' },\n { text: '请求配置', link: '/zh/pages/advanced/request-config' },\n { text: '适配器', link: '/zh/pages/advanced/adapters' },\n { text: '响应结构', link: '/zh/pages/advanced/response-schema' },\n { text: '默认配置', link: '/zh/pages/advanced/config-defaults' },\n { text: '拦截器', link: '/zh/pages/advanced/interceptors' },\n { text: '错误处理', link: '/zh/pages/advanced/error-handling' },\n { text: '取消请求', lin"} | |
| {"repo":"axios","file":"docs/.vitepress/config.mts","line":152,"symbol":"esNav","kind":"constant","lang":"typescript","code":"const esNav = [\n { text: 'Guía', link: '/es/pages/getting-started/first-steps' },\n { text: 'API', link: '/es/pages/advanced/api-reference' },\n { text: 'Patrocinadores', link: '/es/pages/misc/sponsors' },\n { text: 'v1.x', link: '#' },\n];"} | |
| {"repo":"axios","file":"docs/.vitepress/config.mts","line":159,"symbol":"esSidebar","kind":"constant","lang":"typescript","code":"const esSidebar = [\n {\n text: 'Primeros pasos',\n items: [\n { text: 'Inicio', link: '/es/pages/getting-started/first-steps' },\n { text: 'Características', link: '/es/pages/getting-started/features' },\n {\n text: 'Ejemplos',\n items: [\n { text: 'JavaScript', link: '/es/pages/getting-started/examples/commonjs' },\n { text: 'TypeScript', link: '/es/pages/getting-started/examples/typescript' },\n ],\n },\n {\n text: 'Guía de actualización v0.x -> v1.x',\n link: '/es/pages/getting-started/upgrade-guide',\n },\n ],\n },\n {\n text: 'Avanzado',\n items: [\n { text: 'API pública', link: '/es/pages/advanced/api-reference' },\n { text: 'Alias de métodos de solicitud', link: '/es/pages/advanced/request-method-aliases' },\n { text: 'Crear una instancia', link: '/es/pages/advanced/create-an-instance' },\n { text: 'Configuración de solicitud', link: '/es/pages/advanced/request-config' },\n { text: 'Adaptadores', link: '/es/pages/advanced/adapters' },\n { text: 'Esquema de respuesta', link: '/es/pages/advanced/response-schema' },\n { text: 'Configuración predeterminada', link: '/es/pa"} | |
| {"repo":"axios","file":"docs/.vitepress/config.mts","line":233,"symbol":"frNav","kind":"constant","lang":"typescript","code":"const frNav = [\n { text: 'Guide', link: '/fr/pages/getting-started/first-steps' },\n { text: 'API', link: '/fr/pages/advanced/api-reference' },\n { text: 'Sponsors', link: '/fr/pages/misc/sponsors' },\n { text: 'v1.x', link: '#' },\n];"} | |
| {"repo":"axios","file":"docs/.vitepress/config.mts","line":240,"symbol":"frSidebar","kind":"constant","lang":"typescript","code":"const frSidebar = [\n {\n text: 'Démarrage',\n items: [\n { text: 'Premiers pas', link: '/fr/pages/getting-started/first-steps' },\n { text: 'Fonctionnalités', link: '/fr/pages/getting-started/features' },\n {\n text: 'Exemples',\n items: [\n { text: 'JavaScript', link: '/fr/pages/getting-started/examples/commonjs' },\n { text: 'TypeScript', link: '/fr/pages/getting-started/examples/typescript' },\n ],\n },\n {\n text: 'Guide de mise à niveau v0.x -> v1.x',\n link: '/fr/pages/getting-started/upgrade-guide',\n },\n ],\n },\n {\n text: 'Avancé',\n items: [\n { text: 'API publique', link: '/fr/pages/advanced/api-reference' },\n { text: 'Alias des méthodes de requête', link: '/fr/pages/advanced/request-method-aliases' },\n { text: 'Créer une instance', link: '/fr/pages/advanced/create-an-instance' },\n { text: 'Configuration des requêtes', link: '/fr/pages/advanced/request-config' },\n { text: 'Adaptateurs', link: '/fr/pages/advanced/adapters' },\n { text: 'Schéma de réponse', link: '/fr/pages/advanced/response-schema' },\n { text: 'Configuration par défaut', link: '/fr/pages/adv"} | |
| {"repo":"axios","file":"docs/.vitepress/search.mts","line":4,"symbol":"searchConfig","kind":"constant","lang":"typescript","code":"const searchConfig = {\n provider: 'local',\n options: {\n detailedView: 'auto',\n disableQueryPersistence: false,\n miniSearch: {\n options: {\n tokenize: tokenizeSearchText,\n },\n },\n locales: {\n root: {\n translations: {\n button: {\n buttonText: 'Search',\n buttonAriaLabel: 'Search documentation',\n },\n modal: {\n displayDetails: 'Display detailed list',\n resetButtonTitle: 'Reset search',\n backButtonTitle: 'Close search',\n noResultsText: 'No results for',\n footer: {\n selectText: 'to select',\n selectKeyAriaLabel: 'enter',\n navigateText: 'to navigate',\n navigateUpKeyAriaLabel: 'up arrow',\n navigateDownKeyAriaLabel: 'down arrow',\n closeText: 'to close',\n closeKeyAriaLabel: 'escape',\n },\n },\n },\n },\n zh: {\n translations: {\n button: {\n buttonText: '搜索',\n buttonAriaLabel: '搜索文档',\n },\n modal: {\n displayDetails: '显示详细列表',\n resetButtonTitle: '重置搜索',\n "} | |
| {"repo":"axios","file":"docs/.vitepress/theme/SecurityUpdatesBanner.vue","line":1,"symbol":"template","kind":"tag","lang":"vue","code":"<template>"} | |
| {"repo":"axios","file":"docs/.vitepress/theme/SecurityUpdatesBanner.vue","line":2,"symbol":"a","kind":"tag","lang":"vue","code":"<a\n class=\"security-updates-banner\"\n href=\"https://www.herodevs.com/support/nes-for-axios?utm_source=axios-site&utm_medium=referral&utm_campaign=nes-for-axios_global&utm_content=landing-page_none_20260924_a\"\n target=\"_blank\"\n rel=\"noopener noreferrer sponsored\"\n aria-label=\"Get Security Updates for Axios v0 (opens in a new tab)\"\n >"} | |
| {"repo":"axios","file":"docs/.vitepress/theme/SecurityUpdatesBanner.vue","line":9,"symbol":"span","kind":"tag","lang":"vue","code":"<span class=\"security-updates-banner__content\">"} | |
| {"repo":"axios","file":"docs/.vitepress/theme/SecurityUpdatesBanner.vue","line":10,"symbol":"svg","kind":"tag","lang":"vue","code":"<svg\n class=\"security-updates-banner__icon\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n aria-hidden=\"true\"\n >"} | |
| {"repo":"axios","file":"docs/.vitepress/theme/SecurityUpdatesBanner.vue","line":31,"symbol":"span","kind":"tag","lang":"vue","code":"<span>"} | |
| {"repo":"axios","file":"docs/.vitepress/theme/SecurityUpdatesBanner.vue","line":32,"symbol":"span","kind":"tag","lang":"vue","code":"<span class=\"security-updates-banner__arrow\" aria-hidden=\"true\">"} | |
| {"repo":"axios","file":"docs/.vitepress/theme/SecurityUpdatesBanner.vue","line":37,"symbol":"style","kind":"tag","lang":"vue","code":"<style>"} | |
| {"repo":"axios","file":"docs/.vitepress/theme/index.ts","line":16,"symbol":"enhanceApp","kind":"method","lang":"typescript","code":"enhanceApp({ app, router, siteData }) {\n // ...\n }"} | |
| {"repo":"axios","file":"docs/.vitepress/tokenizeSearchText.js","line":13,"symbol":"tokenizeSearchText","kind":"function","lang":"javascript","doc":"longer than one character use bigrams to avoid broad OR matches. @param {string} text @param {string} [fieldName] @returns {string[]}","code":"function tokenizeSearchText(text, fieldName) {\n const separatorPattern = /[\\n\\r\\p{Z}\\p{P}]/u;\n const hanPattern = /\\p{Script=Han}/u;\n const terms = [];\n let token = '';\n let tokenIsHan = false;\n\n const flush = () => {\n if (!token) {\n return;\n }\n\n if (!tokenIsHan) {\n terms.push(token);\n token = '';\n return;\n }\n\n const characters = [...token];\n\n if (fieldName !== undefined || characters.length === 1) {\n terms.push(...characters);\n }\n\n for (let index = 0; index < characters.length - 1; index++) {\n terms.push(characters[index] + characters[index + 1]);\n }\n\n token = '';\n };\n\n for (const character of text) {\n if (separatorPattern.test(character)) {\n flush();\n continue;\n }\n\n const characterIsHan = hanPattern.test(character);\n\n if (token && characterIsHan !== tokenIsHan) {\n flush();\n }\n\n token += character;\n tokenIsHan = characterIsHan;\n }\n\n flush();\n\n return terms;\n}"} | |
| {"repo":"axios","file":"docs/patches/@splidejs+splide+4.1.4.patch","line":4,"symbol":"b/node_modules/@splidejs/splide/package.json","kind":"field","lang":"diff","code":"+++ b/node_modules/@splidejs/splide/package.json"} | |
| {"repo":"axios","file":"examples/network_enhanced.js","line":3,"symbol":"enhanceNetworkError","kind":"function","lang":"javascript","code":"function enhanceNetworkError(error) {\n // when Offline (no internet)\n if (typeof navigator !== 'undefined' && !navigator.onLine) {\n error.code = 'ERR_NO_INTERNET';\n error.detailedMessage =\n 'No internet connection detected. Please check your connection and try again.';\n }\n\n // when DNS failure occurs (invalid domain)\n else if (error.code === 'ENOTFOUND' || /dns/i.test(error.message)) {\n error.code = 'ERR_DNS_FAILURE';\n error.detailedMessage =\n 'Unable to reach the requested domain. Please verify the URL or your network settings.';\n }\n\n // when Connection refused by server\n else if (error.code === 'ECONNREFUSED' || /refused/i.test(error.message)) {\n error.code = 'ERR_CONNECTION_REFUSED';\n error.detailedMessage =\n 'Connection was refused by the server. It may be temporarily unavailable.';\n }\n\n // when Request timeout happens\n else if (error.code === 'ETIMEDOUT' || /timeout/i.test(error.message)) {\n error.code = 'ERR_TIMEOUT';\n error.detailedMessage = 'The request took too long to respond. Please try again later.';\n }\n\n // when CORS restriction happens (for browser only)\n else if (/CORS/i.test(error.message)) {\n error.code = 'ERR"} | |
| {"repo":"axios","file":"examples/network_enhanced.js","line":59,"symbol":"createEnhancedClient","kind":"function","lang":"javascript","code":"function createEnhancedClient(config = {}) {\n const client = axios.create(config);\n\n client.interceptors.response.use(\n (response) => response,\n (error) => {\n throw enhanceNetworkError(error);\n }\n );\n\n return client;\n}"} | |
| {"repo":"axios","file":"examples/server.js","line":14,"symbol":"listDirs","kind":"function","lang":"javascript","code":"function listDirs(root) {\n const files = fs.readdirSync(root);\n const dirs = [];\n\n for (let i = 0, l = files.length; i < l; i++) {\n const file = files[i];\n if (file[0] !== '.') {\n const stat = fs.statSync(path.join(root, file));\n if (stat.isDirectory()) {\n dirs.push(file);\n }\n }\n }\n\n return dirs;\n}"} | |
| {"repo":"axios","file":"examples/server.js","line":31,"symbol":"getIndexTemplate","kind":"function","lang":"javascript","code":"function getIndexTemplate() {\n const links = dirs.map(function (dir) {\n const url = '/' + dir;\n return (\n '<li onclick=\"document.location=\\'' + url + '\\'\"><a href=\"' + url + '\">' + url + '</a></li>'\n );\n });\n\n return (\n '<!doctype html>' +\n '<html>' +\n '<head>' +\n '<title>axios examples</title>' +\n '<style>' +\n 'body {padding:25px;}' +\n 'ul {margin:0; padding:0; list-style:none;}' +\n 'li {padding:5px 10px;}' +\n 'li:hover {background:#eee; cursor:pointer;}' +\n 'a {text-decoration:none; color:#0080ff;}' +\n '</style>' +\n '<body>' +\n '<ul>' +\n links.join('') +\n '</ul>'\n );\n}"} | |
| {"repo":"axios","file":"examples/server.js","line":58,"symbol":"sendResponse","kind":"function","lang":"javascript","code":"function sendResponse(res, statusCode, body) {\n res.writeHead(statusCode);\n res.write(body);\n res.end();\n}"} | |
| {"repo":"axios","file":"examples/server.js","line":64,"symbol":"send200","kind":"function","lang":"javascript","code":"function send200(res, body) {\n sendResponse(res, 200, body || '<h1>OK</h1>');\n}"} | |
| {"repo":"axios","file":"examples/server.js","line":68,"symbol":"send404","kind":"function","lang":"javascript","code":"function send404(res, body) {\n sendResponse(res, 404, body || '<h1>Not Found</h1>');\n}"} | |
| {"repo":"axios","file":"examples/server.js","line":72,"symbol":"pipeFileToResponse","kind":"function","lang":"javascript","code":"function pipeFileToResponse(res, file, type) {\n try {\n // Validate file path - prevent directory traversal\n const safeBasePath = path.join(__dirname, 'examples');\n const resolvedPath = path.resolve(path.join(safeBasePath, file));\n\n // Ensure the resolved path is within intended directory\n if (!resolvedPath.startsWith(safeBasePath)) {\n res.writeHead(400);\n res.end('Invalid file path');\n return;\n }\n\n // Check if file exists\n if (!fs.existsSync(resolvedPath)) {\n res.writeHead(404);\n res.end('File not found');\n return;\n }\n\n if (type) {\n res.writeHead(200, {\n 'Content-Type': type,\n });\n } else {\n res.writeHead(200);\n }\n\n const stream = fs.createReadStream(resolvedPath);\n\n stream.on('error', (err) => {\n console.error('Error while reading file:', err.message);\n if (!res.headersSent) {\n res.writeHead(500, { 'Content-Type': 'text/plain' });\n }\n res.end('File read error');\n });\n\n stream.pipe(res);\n } catch (err) {\n console.error('Unexpected error:', err.message);\n if (!res.headersSent) {\n res.writeHead(500, { 'Content-Type': 'text/plain' });\n }\n re"} | |
| {"repo":"axios","file":"gulpfile.js","line":16,"symbol":"getContributors","kind":"function","lang":"javascript","code":"async function getContributors(user, repo, maxCount = 1) {\n const contributors = (\n await axios.get(\n `https://api.github.com/repos/${encodeURIComponent(user)}/${encodeURIComponent(repo)}/contributors`,\n { params: { per_page: maxCount } }\n )\n ).data;\n\n return Promise.all(\n contributors.map(async (contributor) => {\n return {\n ...contributor,\n ...(\n await axios.get(`https://api.github.com/users/${encodeURIComponent(contributor.login)}`)\n ).data,\n };\n })\n );\n}"} | |
| {"repo":"axios","file":"index.d.cts","line":1,"symbol":"MethodsHeaders","kind":"type","lang":"typescript","code":"type MethodsHeaders = Partial<\n {\n [Key in axios.Method as Lowercase<Key>]: AxiosHeaders;\n } & { common: AxiosHeaders }\n>;"} | |
| {"repo":"axios","file":"index.d.cts","line":7,"symbol":"AxiosHeaderMatcher","kind":"type","lang":"typescript","code":"type AxiosHeaderMatcher =\n | string\n | RegExp\n | ((this: AxiosHeaders, value: string, name: string) => boolean);"} | |
| {"repo":"axios","file":"index.d.cts","line":12,"symbol":"AxiosHeaderParser","kind":"type","lang":"typescript","code":"type AxiosHeaderParser = (this: AxiosHeaders, value: axios.AxiosHeaderValue, header: string) => any;"} | |
| {"repo":"axios","file":"index.d.cts","line":14,"symbol":"CommonRequestHeadersList","kind":"type","lang":"typescript","code":"type CommonRequestHeadersList =\n | 'Accept'\n | 'Content-Length'\n | 'User-Agent'\n | 'Content-Encoding'\n | 'Authorization'\n | 'Location';"} | |
| {"repo":"axios","file":"index.d.cts","line":22,"symbol":"ContentType","kind":"type","lang":"typescript","code":"type ContentType =\n | axios.AxiosHeaderValue\n | 'text/html'\n | 'text/plain'\n | 'multipart/form-data'\n | 'application/json'\n | 'application/x-www-form-urlencoded'\n | 'application/octet-stream';"} | |
| {"repo":"axios","file":"index.d.cts","line":31,"symbol":"CommonResponseHeadersList","kind":"type","lang":"typescript","code":"type CommonResponseHeadersList =\n | 'Server'\n | 'Content-Type'\n | 'Content-Length'\n | 'Cache-Control'\n | 'Content-Encoding';"} | |
| {"repo":"axios","file":"index.d.cts","line":38,"symbol":"CommonResponseHeaderKey","kind":"type","lang":"typescript","code":"type CommonResponseHeaderKey = CommonResponseHeadersList | Lowercase<CommonResponseHeadersList>;"} | |
| {"repo":"axios","file":"index.d.cts","line":40,"symbol":"BrowserProgressEvent","kind":"type","lang":"typescript","code":"type BrowserProgressEvent = any;"} | |
| {"repo":"axios","file":"index.d.cts","line":42,"symbol":"AxiosHeaders","kind":"class","lang":"typescript","code":"class AxiosHeaders {\n constructor(headers?: axios.RawAxiosHeaders | AxiosHeaders | string);\n\n [key: string]: any;\n\n set(\n headerName?: string,\n value?: axios.AxiosHeaderValue,\n rewrite?: boolean | AxiosHeaderMatcher\n ): AxiosHeaders;\n set(headers?: axios.RawAxiosHeaders | AxiosHeaders | string, rewrite?: boolean): AxiosHeaders;\n set(headers?: Iterable<[string, axios.AxiosHeaderValue]>, rewrite?: boolean): AxiosHeaders;\n\n get(\n headerName: string,\n parser: typeof AxiosHeaders.parseParameters\n ): axios.AxiosHeaderParameters;\n get(headerName: string, parser: RegExp): RegExpExecArray | null;\n get(headerName: string, matcher?: true | AxiosHeaderParser): axios.AxiosHeaderValue;\n\n has(header: string, matcher?: AxiosHeaderMatcher): boolean;\n\n delete(header: string | string[], matcher?: AxiosHeaderMatcher): boolean;\n\n clear(matcher?: AxiosHeaderMatcher): boolean;\n\n normalize(format: boolean): AxiosHeaders;\n\n concat(\n ...targets: Array<AxiosHeaders | axios.RawAxiosHeaders | string | undefined | null>\n ): AxiosHeaders;\n\n toJSON(asStrings: true): Record<string, string>;\n toJSON(asStrings?: false): Record<string, string | string[]>;\n toJSON(asStrings?: boole"} | |
| {"repo":"axios","file":"index.d.cts","line":134,"symbol":"AxiosError","kind":"class","lang":"typescript","code":"class AxiosError<T = unknown, D = any, P = any> extends Error {\n constructor(\n message?: string,\n code?: string,\n config?: axios.InternalAxiosRequestConfig<D, P>,\n request?: any,\n response?: axios.AxiosResponse<T, D, {}, P>\n );\n\n config?: axios.InternalAxiosRequestConfig<D, P>;\n code?: string;\n request?: any;\n response?: axios.AxiosResponse<T, D, {}, P>;\n isAxiosError: boolean;\n status?: number;\n toJSON: () => object;\n cause?: Error;\n event?: BrowserProgressEvent;\n static from<T = unknown, D = any, P = any>(\n error: Error | unknown,\n code?: string,\n config?: axios.InternalAxiosRequestConfig<D, P>,\n request?: any,\n response?: axios.AxiosResponse<T, D, {}, P>,\n customProps?: object\n ): AxiosError<T, D, P>;\n static readonly ERR_FR_TOO_MANY_REDIRECTS = 'ERR_FR_TOO_MANY_REDIRECTS';\n static readonly ERR_BAD_OPTION_VALUE = 'ERR_BAD_OPTION_VALUE';\n static readonly ERR_BAD_OPTION = 'ERR_BAD_OPTION';\n static readonly ERR_NETWORK = 'ERR_NETWORK';\n static readonly ERR_DEPRECATED = 'ERR_DEPRECATED';\n static readonly ERR_BAD_RESPONSE = 'ERR_BAD_RESPONSE';\n static readonly ERR_BAD_REQUEST = 'ERR_BAD_REQUEST';\n static readonly ERR_NOT_SUPPORT ="} | |
| {"repo":"axios","file":"index.d.cts","line":176,"symbol":"CanceledError","kind":"class","lang":"typescript","code":"class CanceledError<T, D = any, P = any> extends AxiosError<T, D, P> {\n constructor(message?: string, config?: axios.InternalAxiosRequestConfig<D, P>, request?: any);\n readonly name: 'CanceledError';\n __CANCEL__?: boolean;\n}"} | |
| {"repo":"axios","file":"index.d.cts","line":182,"symbol":"axiosResponseDefault","kind":"constant","lang":"typescript","code":"const axiosResponseDefault: unique symbol;"} | |
| {"repo":"axios","file":"index.d.cts","line":184,"symbol":"AxiosResponseDefault","kind":"type","lang":"typescript","code":"type AxiosResponseDefault = axios.AxiosResponseDefault;"} | |
| {"repo":"axios","file":"index.d.cts","line":186,"symbol":"AxiosResponseResult","kind":"type","lang":"typescript","code":"type AxiosResponseResult<T, R, D, P> = R extends AxiosResponseDefault\n ? axios.AxiosResponse<T, D, {}, P>\n : R;"} | |
| {"repo":"axios","file":"index.d.cts","line":190,"symbol":"Axios","kind":"class","lang":"typescript","code":"class Axios {\n constructor(config?: axios.AxiosRequestConfig);\n defaults: axios.AxiosDefaults;\n interceptors: {\n request: axios.AxiosInterceptorManager<axios.InternalAxiosRequestConfig>;\n response: axios.AxiosInterceptorManager<axios.AxiosResponse>;\n };\n getUri(config?: axios.AxiosRequestConfig): string;\n request<T = any, R = AxiosResponseDefault, D = any, P = any>(\n config: axios.AxiosRequestConfig<D, P>\n ): Promise<AxiosResponseResult<T, R, D, P>>;\n get<T = any, R = AxiosResponseDefault, D = any, P = any>(\n url: string,\n config?: axios.AxiosRequestConfig<D, P>\n ): Promise<AxiosResponseResult<T, R, D, P>>;\n delete<T = any, R = AxiosResponseDefault, D = any, P = any>(\n url: string,\n config?: axios.AxiosRequestConfig<D, P>\n ): Promise<AxiosResponseResult<T, R, D, P>>;\n head<T = any, R = AxiosResponseDefault, D = any, P = any>(\n url: string,\n config?: axios.AxiosRequestConfig<D, P>\n ): Promise<AxiosResponseResult<T, R, D, P>>;\n options<T = any, R = AxiosResponseDefault, D = any, P = any>(\n url: string,\n config?: axios.AxiosRequestConfig<D, P>\n ): Promise<AxiosResponseResult<T, R, D, P>>;\n post<T = any, R = AxiosResponseDefault, D = any"} | |
| {"repo":"axios","file":"index.d.cts","line":254,"symbol":"HttpStatusCode","kind":"type","lang":"typescript","code":"enum HttpStatusCode {\n Continue = 100,\n SwitchingProtocols = 101,\n Processing = 102,\n EarlyHints = 103,\n Ok = 200,\n Created = 201,\n Accepted = 202,\n NonAuthoritativeInformation = 203,\n NoContent = 204,\n ResetContent = 205,\n PartialContent = 206,\n MultiStatus = 207,\n AlreadyReported = 208,\n ImUsed = 226,\n MultipleChoices = 300,\n MovedPermanently = 301,\n Found = 302,\n SeeOther = 303,\n NotModified = 304,\n UseProxy = 305,\n Unused = 306,\n TemporaryRedirect = 307,\n PermanentRedirect = 308,\n BadRequest = 400,\n Unauthorized = 401,\n PaymentRequired = 402,\n Forbidden = 403,\n NotFound = 404,\n MethodNotAllowed = 405,\n NotAcceptable = 406,\n ProxyAuthenticationRequired = 407,\n RequestTimeout = 408,\n Conflict = 409,\n Gone = 410,\n LengthRequired = 411,\n PreconditionFailed = 412,\n /** @deprecated Use `ContentTooLarge` instead. */\n PayloadTooLarge = 413,\n ContentTooLarge = 413,\n UriTooLong = 414,\n UnsupportedMediaType = 415,\n RangeNotSatisfiable = 416,\n ExpectationFailed = 417,\n ImATeapot = 418,\n MisdirectedRequest = 421,\n /** @deprecated Use `UnprocessableContent` instead. */\n UnprocessableEntity = 422,\n UnprocessableContent = 422,\n Locked = 423,\n F"} | |
| {"repo":"axios","file":"index.d.cts","line":331,"symbol":"InternalAxiosError","kind":"type","lang":"typescript","code":"type InternalAxiosError<T = unknown, D = any, P = any> = AxiosError<T, D, P>;"} | |
| {"repo":"axios","file":"index.d.cts","line":334,"symbol":"AxiosResponseDefault","kind":"interface","lang":"typescript","code":"interface AxiosResponseDefault {\n readonly [axiosResponseDefault]: true;\n }"} | |
| {"repo":"axios","file":"index.d.cts","line":338,"symbol":"AxiosHeaderParameters","kind":"type","lang":"typescript","code":"type AxiosHeaderParameters = Record<string, string>;"} | |
| {"repo":"axios","file":"index.d.cts","line":340,"symbol":"AxiosError","kind":"type","lang":"typescript","code":"type AxiosError<T = unknown, D = any, P = any> = InternalAxiosError<T, D, P>;"} | |
| {"repo":"axios","file":"index.d.cts","line":342,"symbol":"RawAxiosHeaders","kind":"interface","lang":"typescript","code":"interface RawAxiosHeaders {\n [key: string]: AxiosHeaderValue;\n }"} | |
| {"repo":"axios","file":"index.d.cts","line":346,"symbol":"RawAxiosRequestHeaders","kind":"type","lang":"typescript","code":"type RawAxiosRequestHeaders = Partial<\n RawAxiosHeaders & {\n [Key in CommonRequestHeadersList]: AxiosHeaderValue;\n } & {\n 'Content-Type': ContentType;\n }\n >;"} | |
| {"repo":"axios","file":"index.d.cts","line":354,"symbol":"AxiosRequestHeaders","kind":"type","lang":"typescript","code":"type AxiosRequestHeaders = RawAxiosRequestHeaders & AxiosHeaders;"} | |
| {"repo":"axios","file":"index.d.cts","line":356,"symbol":"AxiosHeaderValue","kind":"type","lang":"typescript","code":"type AxiosHeaderValue = AxiosHeaders | string | string[] | number | boolean | null;"} | |
| {"repo":"axios","file":"index.d.cts","line":358,"symbol":"RawCommonResponseHeaders","kind":"type","lang":"typescript","code":"type RawCommonResponseHeaders = {\n [Key in CommonResponseHeaderKey]: AxiosHeaderValue;\n } & {\n 'set-cookie': string[];\n };"} | |
| {"repo":"axios","file":"index.d.cts","line":364,"symbol":"RawAxiosResponseHeaders","kind":"type","lang":"typescript","code":"type RawAxiosResponseHeaders = Partial<RawAxiosHeaders & RawCommonResponseHeaders>;"} | |
| {"repo":"axios","file":"index.d.cts","line":366,"symbol":"AxiosResponseHeaders","kind":"type","lang":"typescript","code":"type AxiosResponseHeaders = RawAxiosResponseHeaders & AxiosHeaders;"} | |
| {"repo":"axios","file":"index.d.cts","line":368,"symbol":"AxiosRequestTransformer","kind":"interface","lang":"typescript","code":"interface AxiosRequestTransformer {\n (this: InternalAxiosRequestConfig, data: any, headers: AxiosRequestHeaders): any;\n }"} | |
| {"repo":"axios","file":"index.d.cts","line":372,"symbol":"AxiosResponseTransformer","kind":"interface","lang":"typescript","code":"interface AxiosResponseTransformer {\n (\n this: InternalAxiosRequestConfig,\n data: any,\n headers: AxiosResponseHeaders,\n status?: number\n ): any;\n }"} | |
| {"repo":"axios","file":"index.d.cts","line":381,"symbol":"AxiosAdapter","kind":"interface","lang":"typescript","code":"interface AxiosAdapter {\n (config: InternalAxiosRequestConfig): AxiosPromise;\n }"} | |
| {"repo":"axios","file":"index.d.cts","line":385,"symbol":"AxiosBasicCredentials","kind":"interface","lang":"typescript","code":"interface AxiosBasicCredentials {\n username: string;\n password: string;\n }"} | |
| {"repo":"axios","file":"index.d.cts","line":390,"symbol":"AxiosProxyConfig","kind":"interface","lang":"typescript","code":"interface AxiosProxyConfig {\n host: string;\n port: number;\n auth?: AxiosBasicCredentials;\n protocol?: string;\n }"} | |
| {"repo":"axios","file":"index.d.cts","line":397,"symbol":"UppercaseMethod","kind":"type","lang":"typescript","code":"type UppercaseMethod =\n | 'GET'\n | 'DELETE'\n | 'HEAD'\n | 'OPTIONS'\n | 'POST'\n | 'PUT'\n | 'PATCH'\n | 'PURGE'\n | 'LINK'\n | 'UNLINK'\n | 'QUERY';"} | |
| {"repo":"axios","file":"index.d.cts","line":410,"symbol":"Method","kind":"type","lang":"typescript","code":"type Method = (UppercaseMethod | Lowercase<UppercaseMethod>) & {};"} | |
| {"repo":"axios","file":"index.d.cts","line":412,"symbol":"ResponseType","kind":"type","lang":"typescript","code":"type ResponseType = 'arraybuffer' | 'blob' | 'document' | 'json' | 'text' | 'stream' | 'formdata';"} | |
| {"repo":"axios","file":"index.d.cts","line":414,"symbol":"UppercaseResponseEncoding","kind":"type","lang":"typescript","code":"type UppercaseResponseEncoding =\n | 'ASCII'\n | 'ANSI'\n | 'BINARY'\n | 'BASE64'\n | 'BASE64URL'\n | 'HEX'\n | 'LATIN1'\n | 'UCS-2'\n | 'UCS2'\n | 'UTF-8'\n | 'UTF8'\n | 'UTF16LE';"} | |
| {"repo":"axios","file":"index.d.cts","line":428,"symbol":"responseEncoding","kind":"type","lang":"typescript","code":"type responseEncoding = (UppercaseResponseEncoding | Lowercase<UppercaseResponseEncoding>) & {};"} | |
| {"repo":"axios","file":"index.d.cts","line":430,"symbol":"TransitionalOptions","kind":"interface","lang":"typescript","code":"interface TransitionalOptions {\n silentJSONParsing?: boolean;\n forcedJSONParsing?: boolean;\n clarifyTimeoutError?: boolean;\n legacyInterceptorReqResOrdering?: boolean;\n advertiseZstdAcceptEncoding?: boolean;\n validateStatusUndefinedResolves?: boolean;\n }"} | |
| {"repo":"axios","file":"index.d.cts","line":439,"symbol":"GenericAbortSignal","kind":"interface","lang":"typescript","code":"interface GenericAbortSignal {\n readonly aborted: boolean;\n onabort?: ((...args: any) => any) | null;\n addEventListener?: (...args: any) => any;\n removeEventListener?: (...args: any) => any;\n }"} | |
| {"repo":"axios","file":"index.d.cts","line":446,"symbol":"FormDataVisitorHelpers","kind":"interface","lang":"typescript","code":"interface FormDataVisitorHelpers {\n defaultVisitor: SerializerVisitor;\n convertValue: (value: any) => any;\n isVisitable: (value: any) => boolean;\n }"} | |
| {"repo":"axios","file":"index.d.cts","line":452,"symbol":"SerializerVisitor","kind":"interface","lang":"typescript","code":"interface SerializerVisitor {\n (\n this: GenericFormData,\n value: any,\n key: string | number,\n path: null | Array<string | number>,\n helpers: FormDataVisitorHelpers\n ): boolean;\n }"} | |
| {"repo":"axios","file":"index.d.cts","line":462,"symbol":"SerializerOptions","kind":"interface","lang":"typescript","code":"interface SerializerOptions {\n visitor?: SerializerVisitor;\n dots?: boolean;\n metaTokens?: boolean;\n indexes?: boolean | null;\n maxDepth?: number;\n Blob?: { new (...args: any[]): any };\n }"} | |
| {"repo":"axios","file":"index.d.cts","line":472,"symbol":"FormSerializerOptions","kind":"interface","lang":"typescript","doc":"tslint:disable-next-line","code":"interface FormSerializerOptions extends SerializerOptions {}"} | |
| {"repo":"axios","file":"index.d.cts","line":474,"symbol":"ParamEncoder","kind":"interface","lang":"typescript","code":"interface ParamEncoder {\n (value: any, defaultEncoder: (value: any) => any): any;\n }"} | |
| {"repo":"axios","file":"index.d.cts","line":478,"symbol":"CustomParamsSerializer","kind":"interface","lang":"typescript","code":"interface CustomParamsSerializer<P = Record<string, any>> {\n (params: P, options?: ParamsSerializerOptions<P>): string;\n }"} | |
| {"repo":"axios","file":"index.d.cts","line":482,"symbol":"ParamsSerializerOptions","kind":"interface","lang":"typescript","code":"interface ParamsSerializerOptions<P = Record<string, any>> extends SerializerOptions {\n encode?: ParamEncoder;\n serialize?: CustomParamsSerializer<P>;\n }"} | |
| {"repo":"axios","file":"index.d.cts","line":487,"symbol":"MaxUploadRate","kind":"type","lang":"typescript","code":"type MaxUploadRate = number;"} | |
| {"repo":"axios","file":"index.d.cts","line":489,"symbol":"MaxDownloadRate","kind":"type","lang":"typescript","code":"type MaxDownloadRate = number;"} | |
| {"repo":"axios","file":"index.d.cts","line":491,"symbol":"AxiosProgressEvent","kind":"interface","lang":"typescript","code":"interface AxiosProgressEvent {\n loaded: number;\n total?: number;\n progress?: number;\n bytes: number;\n rate?: number;\n estimated?: number;\n upload?: boolean;\n download?: boolean;\n event?: BrowserProgressEvent;\n lengthComputable: boolean;\n }"} | |
| {"repo":"axios","file":"index.d.cts","line":504,"symbol":"Milliseconds","kind":"type","lang":"typescript","code":"type Milliseconds = number;"} | |
| {"repo":"axios","file":"index.d.cts","line":506,"symbol":"AxiosAdapterName","kind":"type","lang":"typescript","code":"type AxiosAdapterName = 'fetch' | 'xhr' | 'http' | (string & {});"} | |
| {"repo":"axios","file":"index.d.cts","line":508,"symbol":"AxiosAdapterConfig","kind":"type","lang":"typescript","code":"type AxiosAdapterConfig = AxiosAdapter | AxiosAdapterName;"} | |
| {"repo":"axios","file":"index.d.cts","line":510,"symbol":"AddressFamily","kind":"type","lang":"typescript","code":"type AddressFamily = 4 | 6 | undefined;"} | |
| {"repo":"axios","file":"index.d.cts","line":512,"symbol":"LookupAddressEntry","kind":"interface","lang":"typescript","code":"interface LookupAddressEntry {\n address: string;\n family?: AddressFamily;\n }"} | |
| {"repo":"axios","file":"index.d.cts","line":517,"symbol":"LookupAddress","kind":"type","lang":"typescript","code":"type LookupAddress = string | LookupAddressEntry;"} | |
| {"repo":"axios","file":"index.d.cts","line":519,"symbol":"AxiosRequestConfig","kind":"interface","lang":"typescript","code":"interface AxiosRequestConfig<D = any, P = any> {\n url?: string;\n method?: Method | string;\n baseURL?: string;\n allowAbsoluteUrls?: boolean;\n transformRequest?: AxiosRequestTransformer | AxiosRequestTransformer[];\n transformResponse?: AxiosResponseTransformer | AxiosResponseTransformer[];\n headers?: (RawAxiosRequestHeaders & MethodsHeaders) | AxiosHeaders;\n params?: P;\n paramsSerializer?:\n | ParamsSerializerOptions<unknown extends P ? Record<string, any> : P>\n | CustomParamsSerializer<unknown extends P ? Record<string, any> : P>;\n data?: D;\n timeout?: Milliseconds;\n timeoutErrorMessage?: string;\n withCredentials?: boolean;\n adapter?: AxiosAdapterConfig | AxiosAdapterConfig[];\n auth?: AxiosBasicCredentials;\n responseType?: ResponseType;\n responseEncoding?: responseEncoding | string;\n xsrfCookieName?: string;\n xsrfHeaderName?: string;\n onUploadProgress?: (progressEvent: AxiosProgressEvent) => void;\n onDownloadProgress?: (progressEvent: AxiosProgressEvent) => void;\n maxContentLength?: number;\n validateStatus?: ((status: number) => boolean) | null;\n maxBodyLength?: number;\n maxRedirects?: number;\n ma"} | |
| {"repo":"axios","file":"index.d.cts","line":615,"symbol":"RawAxiosRequestConfig","kind":"type","lang":"typescript","doc":"Alias","code":"type RawAxiosRequestConfig<D = any, P = any> = AxiosRequestConfig<D, P>;"} | |
| {"repo":"axios","file":"index.d.cts","line":617,"symbol":"InternalAxiosRequestConfig","kind":"interface","lang":"typescript","code":"interface InternalAxiosRequestConfig<D = any, P = any> extends AxiosRequestConfig<D, P> {\n headers: AxiosRequestHeaders;\n }"} | |
| {"repo":"axios","file":"index.d.cts","line":621,"symbol":"HeadersDefaults","kind":"interface","lang":"typescript","code":"interface HeadersDefaults {\n common: RawAxiosRequestHeaders;\n delete: RawAxiosRequestHeaders;\n get: RawAxiosRequestHeaders;\n head: RawAxiosRequestHeaders;\n post: RawAxiosRequestHeaders;\n put: RawAxiosRequestHeaders;\n patch: RawAxiosRequestHeaders;\n options?: RawAxiosRequestHeaders;\n purge?: RawAxiosRequestHeaders;\n link?: RawAxiosRequestHeaders;\n unlink?: RawAxiosRequestHeaders;\n query?: RawAxiosRequestHeaders;\n }"} | |
| {"repo":"axios","file":"index.d.cts","line":636,"symbol":"AxiosDefaults","kind":"interface","lang":"typescript","code":"interface AxiosDefaults<D = any, P = any> extends Omit<AxiosRequestConfig<D, P>, 'headers'> {\n headers: HeadersDefaults;\n }"} | |
| {"repo":"axios","file":"index.d.ts","line":2,"symbol":"StringLiteralsOrString","kind":"type","lang":"typescript","doc":"TypeScript Version: 4.7","code":"type StringLiteralsOrString<Literals extends string> = Literals | (string & {});"} | |
| {"repo":"axios","file":"index.d.ts","line":4,"symbol":"AxiosHeaderValue","kind":"type","lang":"typescript","code":"type AxiosHeaderValue = AxiosHeaders | string | string[] | number | boolean | null;"} | |
| {"repo":"axios","file":"index.d.ts","line":6,"symbol":"AxiosHeaderParameters","kind":"type","lang":"typescript","code":"type AxiosHeaderParameters = Record<string, string>;"} | |
| {"repo":"axios","file":"index.d.ts","line":8,"symbol":"RawAxiosHeaders","kind":"interface","lang":"typescript","code":"interface RawAxiosHeaders {\n [key: string]: AxiosHeaderValue;\n}"} | |
| {"repo":"axios","file":"index.d.ts","line":12,"symbol":"MethodsHeaders","kind":"type","lang":"typescript","code":"type MethodsHeaders = Partial<\n {\n [Key in Method as Lowercase<Key>]: AxiosHeaders;\n } & { common: AxiosHeaders }\n>;"} | |
| {"repo":"axios","file":"index.d.ts","line":18,"symbol":"AxiosHeaderMatcher","kind":"type","lang":"typescript","code":"type AxiosHeaderMatcher =\n | string\n | RegExp\n | ((this: AxiosHeaders, value: string, name: string) => boolean);"} | |
| {"repo":"axios","file":"index.d.ts","line":23,"symbol":"AxiosHeaderParser","kind":"type","lang":"typescript","code":"type AxiosHeaderParser = (this: AxiosHeaders, value: AxiosHeaderValue, header: string) => any;"} | |
| {"repo":"axios","file":"index.d.ts","line":25,"symbol":"AxiosHeaders","kind":"class","lang":"typescript","code":"class AxiosHeaders {\n constructor(headers?: RawAxiosHeaders | AxiosHeaders | string);\n\n [key: string]: any;\n\n set(\n headerName?: string,\n value?: AxiosHeaderValue,\n rewrite?: boolean | AxiosHeaderMatcher\n ): AxiosHeaders;\n set(headers?: RawAxiosHeaders | AxiosHeaders | string, rewrite?: boolean): AxiosHeaders;\n set(headers?: Iterable<[string, AxiosHeaderValue]>, rewrite?: boolean): AxiosHeaders;\n\n get(headerName: string, parser: typeof AxiosHeaders.parseParameters): AxiosHeaderParameters;\n get(headerName: string, parser: RegExp): RegExpExecArray | null;\n get(headerName: string, matcher?: true | AxiosHeaderParser): AxiosHeaderValue;\n\n has(header: string, matcher?: AxiosHeaderMatcher): boolean;\n\n delete(header: string | string[], matcher?: AxiosHeaderMatcher): boolean;\n\n clear(matcher?: AxiosHeaderMatcher): boolean;\n\n normalize(format: boolean): AxiosHeaders;\n\n concat(\n ...targets: Array<AxiosHeaders | RawAxiosHeaders | string | undefined | null>\n ): AxiosHeaders;\n\n toJSON(asStrings: true): Record<string, string>;\n toJSON(asStrings?: false): Record<string, string | string[]>;\n toJSON(asStrings?: boolean): Record<string, string | string[]>;\n\n static from"} | |
| {"repo":"axios","file":"index.d.ts","line":105,"symbol":"CommonRequestHeadersList","kind":"type","lang":"typescript","code":"type CommonRequestHeadersList =\n | 'Accept'\n | 'Content-Length'\n | 'User-Agent'\n | 'Content-Encoding'\n | 'Authorization'\n | 'Location';"} | |
| {"repo":"axios","file":"index.d.ts","line":113,"symbol":"ContentType","kind":"type","lang":"typescript","code":"type ContentType =\n | AxiosHeaderValue\n | 'text/html'\n | 'text/plain'\n | 'multipart/form-data'\n | 'application/json'\n | 'application/x-www-form-urlencoded'\n | 'application/octet-stream';"} | |
| {"repo":"axios","file":"index.d.ts","line":122,"symbol":"RawAxiosRequestHeaders","kind":"type","lang":"typescript","code":"type RawAxiosRequestHeaders = Partial<\n RawAxiosHeaders & {\n [Key in CommonRequestHeadersList]: AxiosHeaderValue;\n } & {\n 'Content-Type': ContentType;\n }\n>;"} | |
| {"repo":"axios","file":"index.d.ts","line":130,"symbol":"AxiosRequestHeaders","kind":"type","lang":"typescript","code":"type AxiosRequestHeaders = RawAxiosRequestHeaders & AxiosHeaders;"} | |
| {"repo":"axios","file":"index.d.ts","line":132,"symbol":"CommonResponseHeadersList","kind":"type","lang":"typescript","code":"type CommonResponseHeadersList =\n | 'Server'\n | 'Content-Type'\n | 'Content-Length'\n | 'Cache-Control'\n | 'Content-Encoding';"} | |
| {"repo":"axios","file":"index.d.ts","line":139,"symbol":"CommonResponseHeaderKey","kind":"type","lang":"typescript","code":"type CommonResponseHeaderKey = CommonResponseHeadersList | Lowercase<CommonResponseHeadersList>;"} | |
| {"repo":"axios","file":"index.d.ts","line":141,"symbol":"RawCommonResponseHeaders","kind":"type","lang":"typescript","code":"type RawCommonResponseHeaders = {\n [Key in CommonResponseHeaderKey]: AxiosHeaderValue;\n} & {\n 'set-cookie': string[];\n};"} | |
| {"repo":"axios","file":"index.d.ts","line":147,"symbol":"RawAxiosResponseHeaders","kind":"type","lang":"typescript","code":"type RawAxiosResponseHeaders = Partial<RawAxiosHeaders & RawCommonResponseHeaders>;"} | |
| {"repo":"axios","file":"index.d.ts","line":149,"symbol":"AxiosResponseHeaders","kind":"type","lang":"typescript","code":"type AxiosResponseHeaders = RawAxiosResponseHeaders & AxiosHeaders;"} | |
| {"repo":"axios","file":"index.d.ts","line":151,"symbol":"AxiosRequestTransformer","kind":"interface","lang":"typescript","code":"interface AxiosRequestTransformer {\n (this: InternalAxiosRequestConfig, data: any, headers: AxiosRequestHeaders): any;\n}"} | |
| {"repo":"axios","file":"index.d.ts","line":155,"symbol":"AxiosResponseTransformer","kind":"interface","lang":"typescript","code":"interface AxiosResponseTransformer {\n (\n this: InternalAxiosRequestConfig,\n data: any,\n headers: AxiosResponseHeaders,\n status?: number\n ): any;\n}"} | |
| {"repo":"axios","file":"index.d.ts","line":164,"symbol":"AxiosAdapter","kind":"interface","lang":"typescript","code":"interface AxiosAdapter {\n (config: InternalAxiosRequestConfig): AxiosPromise;\n}"} | |
| {"repo":"axios","file":"index.d.ts","line":168,"symbol":"AxiosBasicCredentials","kind":"interface","lang":"typescript","code":"interface AxiosBasicCredentials {\n username: string;\n password: string;\n}"} | |
| {"repo":"axios","file":"index.d.ts","line":173,"symbol":"AxiosProxyConfig","kind":"interface","lang":"typescript","code":"interface AxiosProxyConfig {\n host: string;\n port: number;\n auth?: AxiosBasicCredentials;\n protocol?: string;\n}"} | |
| {"repo":"axios","file":"index.d.ts","line":180,"symbol":"HttpStatusCode","kind":"type","lang":"typescript","code":"enum HttpStatusCode {\n Continue = 100,\n SwitchingProtocols = 101,\n Processing = 102,\n EarlyHints = 103,\n Ok = 200,\n Created = 201,\n Accepted = 202,\n NonAuthoritativeInformation = 203,\n NoContent = 204,\n ResetContent = 205,\n PartialContent = 206,\n MultiStatus = 207,\n AlreadyReported = 208,\n ImUsed = 226,\n MultipleChoices = 300,\n MovedPermanently = 301,\n Found = 302,\n SeeOther = 303,\n NotModified = 304,\n UseProxy = 305,\n Unused = 306,\n TemporaryRedirect = 307,\n PermanentRedirect = 308,\n BadRequest = 400,\n Unauthorized = 401,\n PaymentRequired = 402,\n Forbidden = 403,\n NotFound = 404,\n MethodNotAllowed = 405,\n NotAcceptable = 406,\n ProxyAuthenticationRequired = 407,\n RequestTimeout = 408,\n Conflict = 409,\n Gone = 410,\n LengthRequired = 411,\n PreconditionFailed = 412,\n /** @deprecated Use `ContentTooLarge` instead. */\n PayloadTooLarge = 413,\n ContentTooLarge = 413,\n UriTooLong = 414,\n UnsupportedMediaType = 415,\n RangeNotSatisfiable = 416,\n ExpectationFailed = 417,\n ImATeapot = 418,\n MisdirectedRequest = 421,\n /** @deprecated Use `UnprocessableContent` instead. */\n UnprocessableEntity = 422,\n UnprocessableContent = 422,\n Locked = 423,\n F"} | |
| {"repo":"axios","file":"index.d.ts","line":257,"symbol":"UppercaseMethod","kind":"type","lang":"typescript","code":"type UppercaseMethod =\n | 'GET'\n | 'DELETE'\n | 'HEAD'\n | 'OPTIONS'\n | 'POST'\n | 'PUT'\n | 'PATCH'\n | 'PURGE'\n | 'LINK'\n | 'UNLINK'\n | 'QUERY';"} | |
| {"repo":"axios","file":"index.d.ts","line":270,"symbol":"Method","kind":"type","lang":"typescript","code":"type Method = (UppercaseMethod | Lowercase<UppercaseMethod>) & {};"} | |
| {"repo":"axios","file":"index.d.ts","line":272,"symbol":"ResponseType","kind":"type","lang":"typescript","code":"type ResponseType =\n | 'arraybuffer'\n | 'blob'\n | 'document'\n | 'json'\n | 'text'\n | 'stream'\n | 'formdata';"} | |
| {"repo":"axios","file":"index.d.ts","line":281,"symbol":"UppercaseResponseEncoding","kind":"type","lang":"typescript","code":"type UppercaseResponseEncoding =\n | 'ASCII'\n | 'ANSI'\n | 'BINARY'\n | 'BASE64'\n | 'BASE64URL'\n | 'HEX'\n | 'LATIN1'\n | 'UCS-2'\n | 'UCS2'\n | 'UTF-8'\n | 'UTF8'\n | 'UTF16LE';"} | |
| {"repo":"axios","file":"index.d.ts","line":295,"symbol":"responseEncoding","kind":"type","lang":"typescript","code":"type responseEncoding = (\n | UppercaseResponseEncoding\n | Lowercase<UppercaseResponseEncoding>\n) & {};"} | |
| {"repo":"axios","file":"index.d.ts","line":300,"symbol":"TransitionalOptions","kind":"interface","lang":"typescript","code":"interface TransitionalOptions {\n silentJSONParsing?: boolean;\n forcedJSONParsing?: boolean;\n clarifyTimeoutError?: boolean;\n legacyInterceptorReqResOrdering?: boolean;\n advertiseZstdAcceptEncoding?: boolean;\n validateStatusUndefinedResolves?: boolean;\n}"} | |
| {"repo":"axios","file":"index.d.ts","line":309,"symbol":"GenericAbortSignal","kind":"interface","lang":"typescript","code":"interface GenericAbortSignal {\n readonly aborted: boolean;\n onabort?: ((...args: any) => any) | null;\n addEventListener?: (...args: any) => any;\n removeEventListener?: (...args: any) => any;\n}"} | |
| {"repo":"axios","file":"index.d.ts","line":316,"symbol":"FormDataVisitorHelpers","kind":"interface","lang":"typescript","code":"interface FormDataVisitorHelpers {\n defaultVisitor: SerializerVisitor;\n convertValue: (value: any) => any;\n isVisitable: (value: any) => boolean;\n}"} | |
| {"repo":"axios","file":"index.d.ts","line":322,"symbol":"SerializerVisitor","kind":"interface","lang":"typescript","code":"interface SerializerVisitor {\n (\n this: GenericFormData,\n value: any,\n key: string | number,\n path: null | Array<string | number>,\n helpers: FormDataVisitorHelpers\n ): boolean;\n}"} | |
| {"repo":"axios","file":"index.d.ts","line":332,"symbol":"SerializerOptions","kind":"interface","lang":"typescript","code":"interface SerializerOptions {\n visitor?: SerializerVisitor;\n dots?: boolean;\n metaTokens?: boolean;\n indexes?: boolean | null;\n maxDepth?: number;\n Blob?: { new (...args: any[]): any };\n}"} | |
| {"repo":"axios","file":"index.d.ts","line":342,"symbol":"FormSerializerOptions","kind":"interface","lang":"typescript","doc":"tslint:disable-next-line","code":"interface FormSerializerOptions extends SerializerOptions {}"} | |
| {"repo":"axios","file":"index.d.ts","line":344,"symbol":"ParamEncoder","kind":"interface","lang":"typescript","code":"interface ParamEncoder {\n (value: any, defaultEncoder: (value: any) => any): any;\n}"} | |
| {"repo":"axios","file":"index.d.ts","line":348,"symbol":"CustomParamsSerializer","kind":"interface","lang":"typescript","code":"interface CustomParamsSerializer<P = Record<string, any>> {\n (params: P, options?: ParamsSerializerOptions<P>): string;\n}"} | |
| {"repo":"axios","file":"index.d.ts","line":352,"symbol":"ParamsSerializerOptions","kind":"interface","lang":"typescript","code":"interface ParamsSerializerOptions<P = Record<string, any>> extends SerializerOptions {\n encode?: ParamEncoder;\n serialize?: CustomParamsSerializer<P>;\n}"} | |
| {"repo":"axios","file":"index.d.ts","line":357,"symbol":"MaxUploadRate","kind":"type","lang":"typescript","code":"type MaxUploadRate = number;"} | |
| {"repo":"axios","file":"index.d.ts","line":359,"symbol":"MaxDownloadRate","kind":"type","lang":"typescript","code":"type MaxDownloadRate = number;"} | |
| {"repo":"axios","file":"index.d.ts","line":361,"symbol":"BrowserProgressEvent","kind":"type","lang":"typescript","code":"type BrowserProgressEvent = any;"} | |
| {"repo":"axios","file":"index.d.ts","line":363,"symbol":"AxiosProgressEvent","kind":"interface","lang":"typescript","code":"interface AxiosProgressEvent {\n loaded: number;\n total?: number;\n progress?: number;\n bytes: number;\n rate?: number;\n estimated?: number;\n upload?: boolean;\n download?: boolean;\n event?: BrowserProgressEvent;\n lengthComputable: boolean;\n}"} | |
| {"repo":"axios","file":"index.d.ts","line":376,"symbol":"Milliseconds","kind":"type","lang":"typescript","code":"type Milliseconds = number;"} | |
| {"repo":"axios","file":"index.d.ts","line":378,"symbol":"AxiosAdapterName","kind":"type","lang":"typescript","code":"type AxiosAdapterName = StringLiteralsOrString<'xhr' | 'http' | 'fetch'>;"} | |
| {"repo":"axios","file":"index.d.ts","line":380,"symbol":"AxiosAdapterConfig","kind":"type","lang":"typescript","code":"type AxiosAdapterConfig = AxiosAdapter | AxiosAdapterName;"} | |
| {"repo":"axios","file":"index.d.ts","line":382,"symbol":"AddressFamily","kind":"type","lang":"typescript","code":"type AddressFamily = 4 | 6 | undefined;"} | |
| {"repo":"axios","file":"index.d.ts","line":384,"symbol":"LookupAddressEntry","kind":"interface","lang":"typescript","code":"interface LookupAddressEntry {\n address: string;\n family?: AddressFamily;\n}"} | |
| {"repo":"axios","file":"index.d.ts","line":389,"symbol":"LookupAddress","kind":"type","lang":"typescript","code":"type LookupAddress = string | LookupAddressEntry;"} | |
| {"repo":"axios","file":"index.d.ts","line":391,"symbol":"AxiosRequestConfig","kind":"interface","lang":"typescript","code":"interface AxiosRequestConfig<D = any, P = any> {\n url?: string;\n method?: StringLiteralsOrString<Method>;\n baseURL?: string;\n allowAbsoluteUrls?: boolean;\n transformRequest?: AxiosRequestTransformer | AxiosRequestTransformer[];\n transformResponse?: AxiosResponseTransformer | AxiosResponseTransformer[];\n headers?: (RawAxiosRequestHeaders & MethodsHeaders) | AxiosHeaders;\n params?: P;\n paramsSerializer?:\n | ParamsSerializerOptions<unknown extends P ? Record<string, any> : P>\n | CustomParamsSerializer<unknown extends P ? Record<string, any> : P>;\n data?: D;\n timeout?: Milliseconds;\n timeoutErrorMessage?: string;\n withCredentials?: boolean;\n adapter?: AxiosAdapterConfig | AxiosAdapterConfig[];\n auth?: AxiosBasicCredentials;\n responseType?: ResponseType;\n responseEncoding?: StringLiteralsOrString<responseEncoding>;\n xsrfCookieName?: string;\n xsrfHeaderName?: string;\n onUploadProgress?: (progressEvent: AxiosProgressEvent) => void;\n onDownloadProgress?: (progressEvent: AxiosProgressEvent) => void;\n maxContentLength?: number;\n validateStatus?: ((status: number) => boolean) | null;\n maxBodyLength?: number;\n maxRedirects?: number;\n maxRate?: number | [MaxUploa"} | |
| {"repo":"axios","file":"index.d.ts","line":491,"symbol":"RawAxiosRequestConfig","kind":"type","lang":"typescript","doc":"Alias","code":"type RawAxiosRequestConfig<D = any, P = any> = AxiosRequestConfig<D, P>;"} | |
| {"repo":"axios","file":"index.d.ts","line":493,"symbol":"InternalAxiosRequestConfig","kind":"interface","lang":"typescript","code":"interface InternalAxiosRequestConfig<D = any, P = any> extends AxiosRequestConfig<D, P> {\n headers: AxiosRequestHeaders;\n}"} | |
| {"repo":"axios","file":"index.d.ts","line":497,"symbol":"HeadersDefaults","kind":"interface","lang":"typescript","code":"interface HeadersDefaults {\n common: RawAxiosRequestHeaders;\n delete: RawAxiosRequestHeaders;\n get: RawAxiosRequestHeaders;\n head: RawAxiosRequestHeaders;\n post: RawAxiosRequestHeaders;\n put: RawAxiosRequestHeaders;\n patch: RawAxiosRequestHeaders;\n options?: RawAxiosRequestHeaders;\n purge?: RawAxiosRequestHeaders;\n link?: RawAxiosRequestHeaders;\n unlink?: RawAxiosRequestHeaders;\n query?: RawAxiosRequestHeaders;\n}"} | |
| {"repo":"axios","file":"index.d.ts","line":512,"symbol":"AxiosDefaults","kind":"interface","lang":"typescript","code":"interface AxiosDefaults<D = any, P = any> extends Omit<AxiosRequestConfig<D, P>, 'headers'> {\n headers: HeadersDefaults;\n}"} | |
| {"repo":"axios","file":"index.d.ts","line":516,"symbol":"CreateAxiosDefaults","kind":"interface","lang":"typescript","code":"interface CreateAxiosDefaults<D = any, P = any> extends Omit<\n AxiosRequestConfig<D, P>,\n 'headers'\n> {\n headers?: RawAxiosRequestHeaders | AxiosHeaders | Partial<HeadersDefaults>;\n}"} | |
| {"repo":"axios","file":"index.d.ts","line":523,"symbol":"AxiosResponse","kind":"interface","lang":"typescript","code":"interface AxiosResponse<T = any, D = any, H = {}, P = any> {\n data: T;\n status: number;\n statusText: string;\n headers: (H & RawAxiosResponseHeaders) | AxiosResponseHeaders;\n config: InternalAxiosRequestConfig<D, P>;\n request?: any;\n}"} | |
| {"repo":"axios","file":"index.d.ts","line":532,"symbol":"AxiosError","kind":"class","lang":"typescript","code":"class AxiosError<T = unknown, D = any, P = any> extends Error {\n constructor(\n message?: string,\n code?: string,\n config?: InternalAxiosRequestConfig<D, P>,\n request?: any,\n response?: AxiosResponse<T, D, {}, P>\n );\n\n config?: InternalAxiosRequestConfig<D, P>;\n code?: string;\n request?: any;\n response?: AxiosResponse<T, D, {}, P>;\n isAxiosError: boolean;\n status?: number;\n toJSON: () => object;\n cause?: Error;\n event?: BrowserProgressEvent;\n static from<T = unknown, D = any, P = any>(\n error: Error | unknown,\n code?: string,\n config?: InternalAxiosRequestConfig<D, P>,\n request?: any,\n response?: AxiosResponse<T, D, {}, P>,\n customProps?: object\n ): AxiosError<T, D, P>;\n static readonly ERR_FR_TOO_MANY_REDIRECTS = 'ERR_FR_TOO_MANY_REDIRECTS';\n static readonly ERR_BAD_OPTION_VALUE = 'ERR_BAD_OPTION_VALUE';\n static readonly ERR_BAD_OPTION = 'ERR_BAD_OPTION';\n static readonly ERR_NETWORK = 'ERR_NETWORK';\n static readonly ERR_DEPRECATED = 'ERR_DEPRECATED';\n static readonly ERR_BAD_RESPONSE = 'ERR_BAD_RESPONSE';\n static readonly ERR_BAD_REQUEST = 'ERR_BAD_REQUEST';\n static readonly ERR_NOT_SUPPORT = 'ERR_NOT_SUPPORT';\n static readonl"} | |
| {"repo":"axios","file":"index.d.ts","line":574,"symbol":"CanceledError","kind":"class","lang":"typescript","code":"class CanceledError<T, D = any, P = any> extends AxiosError<T, D, P> {\n constructor(message?: string, config?: InternalAxiosRequestConfig<D, P>, request?: any);\n readonly name: 'CanceledError';\n __CANCEL__?: boolean;\n}"} | |
| {"repo":"axios","file":"index.d.ts","line":580,"symbol":"axiosResponseDefault","kind":"constant","lang":"typescript","code":"const axiosResponseDefault: unique symbol;"} | |
| {"repo":"axios","file":"index.d.ts","line":582,"symbol":"AxiosResponseDefault","kind":"interface","lang":"typescript","code":"interface AxiosResponseDefault {\n readonly [axiosResponseDefault]: true;\n}"} | |
| {"repo":"axios","file":"index.d.ts","line":586,"symbol":"AxiosResponseResult","kind":"type","lang":"typescript","code":"type AxiosResponseResult<T, R, D, P> = R extends AxiosResponseDefault\n ? AxiosResponse<T, D, {}, P>\n : R;"} | |
| {"repo":"axios","file":"index.d.ts","line":590,"symbol":"AxiosPromise","kind":"type","lang":"typescript","code":"type AxiosPromise<T = any, D = any, P = any> = Promise<AxiosResponse<T, D, {}, P>>;"} | |
| {"repo":"axios","file":"lib/adapters/adapters.js","line":65,"symbol":"getAdapter","kind":"function","lang":"javascript","doc":"@param {Array<string|Function>|string|Function} adapters - Adapter(s) by name or function. @param {Object} config - Axios request configuration @throws {AxiosError} If no suitable adapter is available @returns {Function} The resolved adapter function","code":"function getAdapter(adapters, config) {\n adapters = utils.isArray(adapters) ? adapters : [adapters];\n\n const { length } = adapters;\n let nameOrAdapter;\n let adapter;\n\n const rejectedReasons = {};\n\n for (let i = 0; i < length; i++) {\n nameOrAdapter = adapters[i];\n let id;\n\n adapter = nameOrAdapter;\n\n if (!isResolvedHandle(nameOrAdapter)) {\n adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()];\n\n if (adapter === undefined) {\n throw new AxiosError(`Unknown adapter '${id}'`);\n }\n }\n\n if (adapter && (utils.isFunction(adapter) || (adapter = adapter.get(config)))) {\n break;\n }\n\n rejectedReasons[id || '#' + i] = adapter;\n }\n\n if (!adapter) {\n const reasons = Object.entries(rejectedReasons).map(\n ([id, state]) =>\n `adapter ${id} ` +\n (state === false ? 'is not supported by the environment' : 'is not available in the build')\n );\n\n let s = length\n ? reasons.length > 1\n ? 'since :\\n' + reasons.map(renderReason).join('\\n')\n : ' ' + renderReason(reasons[0])\n : 'as no adapter specified';\n\n throw new AxiosError(\n `There is no suitable adapter to dispatch the request"} | |
| {"repo":"axios","file":"lib/adapters/fetch.js","line":128,"symbol":"duplex","kind":"method","lang":"javascript","code":"get duplex() {\n duplexAccessed = true;\n return 'half';\n }"} | |
| {"repo":"axios","file":"lib/adapters/http.js","line":73,"symbol":"handleSocketError","kind":"function","lang":"javascript","doc":"A shared listener avoids retaining an adapter context for the lifetime of a pooled socket. EventEmitter invokes listeners with `this` set to the emitter.","code":"function handleSocketError(err) {\n const current = this[kAxiosCurrentReq];\n if (current && !current.destroyed) {\n current.destroy(err);\n }\n}"} | |
| {"repo":"axios","file":"lib/adapters/http.js","line":111,"symbol":"isNodeNativeEnvProxySupported","kind":"function","lang":"javascript","code":"function isNodeNativeEnvProxySupported(nodeVersion = process.versions && process.versions.node) {\n if (!nodeVersion) {\n return false;\n }\n\n const [major, minor] = nodeVersion.split('.').map((part) => Number(part));\n\n if (!Number.isInteger(major) || !Number.isInteger(minor)) {\n return false;\n }\n\n if (major > 24) {\n return true;\n }\n\n return (\n NODE_NATIVE_ENV_PROXY_SUPPORT[major] != null && minor >= NODE_NATIVE_ENV_PROXY_SUPPORT[major]\n );\n}"} | |
| {"repo":"axios","file":"lib/adapters/http.js","line":131,"symbol":"isNodeEnvProxyEnabled","kind":"function","lang":"javascript","code":"function isNodeEnvProxyEnabled(agent, nodeVersion = process.versions && process.versions.node) {\n if (!isNodeNativeEnvProxySupported(nodeVersion)) {\n return false;\n }\n\n const agentOptions = agent && agent.options;\n\n return Boolean(\n agentOptions && utils.hasOwnProp(agentOptions, 'proxyEnv') && agentOptions.proxyEnv != null\n );\n}"} | |
| {"repo":"axios","file":"lib/adapters/http.js","line":143,"symbol":"getProxyEnvAgent","kind":"function","lang":"javascript","code":"function getProxyEnvAgent(options, configHttpAgent, configHttpsAgent) {\n return isHttps.test(options.protocol)\n ? configHttpsAgent || https.globalAgent\n : configHttpAgent || http.globalAgent;\n}"} | |
| {"repo":"axios","file":"lib/adapters/http.js","line":149,"symbol":"getDirectAgent","kind":"function","lang":"javascript","code":"function getDirectAgent(configuredAgent, transport) {\n if (\n !process.allowedNodeEnvironmentFlags ||\n !process.allowedNodeEnvironmentFlags.has('--use-env-proxy')\n ) {\n return configuredAgent;\n }\n\n const agent = configuredAgent || transport.globalAgent;\n const options = agent && agent.options;\n if (\n !(agent instanceof transport.Agent) ||\n agent.protocol !== transport.globalAgent.protocol ||\n !options ||\n !utils.hasOwnProp(options, 'proxyEnv') ||\n typeof options.proxyEnv !== 'object' ||\n options.proxyEnv === null\n ) {\n return configuredAgent;\n }\n\n // These hooks own pool queues or TLS session state. Neither binding them to\n // the source agent nor copying them without subclass state preserves their\n // behavior on a separate direct pool.\n for (const hook of nativeAgentPoolHooks) {\n if (\n utils.isFunction(transport.Agent.prototype[hook]) &&\n agent[hook] !== transport.Agent.prototype[hook]\n ) {\n throw new AxiosError(\n 'proxy: false cannot adapt an agent overriding ' +\n hook +\n '; use an agent constructed without proxyEnv',\n AxiosError.ERR_BAD_OPTION_VALUE\n );\n }\n }\n\n // Node snapsh"} | |
| {"repo":"axios","file":"lib/adapters/http.js","line":217,"symbol":"setDirectAgent","kind":"function","lang":"javascript","code":"function setDirectAgent(options, configHttpAgent, configHttpsAgent) {\n const secure = isHttps.test(options.protocol);\n const agent = getDirectAgent(secure ? configHttpsAgent : configHttpAgent, secure ? https : http);\n options.agent = agent;\n if (options.agents) {\n options.agents[secure ? 'https' : 'http'] = agent;\n }\n}"} | |
| {"repo":"axios","file":"lib/adapters/http.js","line":226,"symbol":"getTunnelingAgent","kind":"function","lang":"javascript","code":"function getTunnelingAgent(agentOptions, userHttpsAgent) {\n const key =\n agentOptions.protocol +\n '//' +\n agentOptions.hostname +\n ':' +\n (agentOptions.port || '') +\n '#' +\n (agentOptions.auth || '');\n const cache = userHttpsAgent\n ? tunnelingAgentCacheUser.get(userHttpsAgent) ||\n tunnelingAgentCacheUser.set(userHttpsAgent, new Map()).get(userHttpsAgent)\n : tunnelingAgentCache;\n let agent = cache.get(key);\n if (agent) return agent;\n // Forward the user's TLS options (custom CA, rejectUnauthorized, client cert,\n // etc.) into the tunneling agent so they apply to the origin TLS upgrade\n // performed after CONNECT. Our proxy fields take precedence on conflict.\n const merged =\n userHttpsAgent && userHttpsAgent.options\n ? { ...userHttpsAgent.options, ...agentOptions }\n : agentOptions;\n agent = new HttpsProxyAgent(merged);\n if (userHttpsAgent && userHttpsAgent.options) {\n const originTLSOptions = { ...userHttpsAgent.options };\n const callback = agent.callback;\n agent.callback = function axiosTunnelingAgentCallback(req, opts) {\n // HttpsProxyAgent v5 reads callback opts for the post-CONNECT origin TLS upgrade.\n retu"} | |
| {"repo":"axios","file":"lib/adapters/http.js","line":298,"symbol":"dispatchBeforeRedirect","kind":"function","lang":"javascript","doc":"call them with the options object. @param {Object<string, any>} options - The options object that was passed to the request. @returns {Object<string, any>}","code":"function dispatchBeforeRedirect(options, responseDetails, requestDetails) {\n if (!isSameOriginRedirect(options, requestDetails)) {\n stripMatchingHeaders(options.headers, new Set(['authorization', 'cookie']));\n delete options.auth;\n }\n if (options.beforeRedirects.proxy) {\n options.beforeRedirects.proxy(options);\n }\n if (options.beforeRedirects.auth) {\n options.beforeRedirects.auth(options);\n }\n if (options.beforeRedirects.sensitiveHeaders) {\n options.beforeRedirects.sensitiveHeaders(options, requestDetails);\n }\n if (options.beforeRedirects.direct) {\n options.beforeRedirects.direct(options);\n }\n if (options.beforeRedirects.config) {\n options.beforeRedirects.config(options, responseDetails, requestDetails);\n }\n}"} | |
| {"repo":"axios","file":"lib/adapters/http.js","line":320,"symbol":"stripMatchingHeaders","kind":"function","lang":"javascript","code":"function stripMatchingHeaders(headers, sensitiveSet) {\n if (!headers) {\n return;\n }\n\n Object.keys(headers).forEach((header) => {\n if (sensitiveSet.has(header.toLowerCase())) {\n delete headers[header];\n }\n });\n}"} | |
| {"repo":"axios","file":"lib/adapters/http.js","line":332,"symbol":"isSameOriginRedirect","kind":"function","lang":"javascript","code":"function isSameOriginRedirect(redirectOptions, requestDetails) {\n if (!requestDetails) {\n return false;\n }\n\n try {\n return new URL(requestDetails.url).origin === new URL(redirectOptions.href).origin;\n } catch (e) {\n // If origin comparison fails, treat the redirect as unsafe.\n return false;\n }\n}"} | |
| {"repo":"axios","file":"lib/adapters/http.js","line":355,"symbol":"setProxy","kind":"function","lang":"javascript","doc":"@param {AxiosProxyConfig} configProxy configuration from Axios options object @param {string} location @param {boolean} [allowEnvProxy=true] whether environment proxy configuration can be used @returns {boolean} whether a proxy applies to the selected transport","code":"function setProxy(\n options,\n configProxy,\n location,\n isRedirect,\n configHttpsAgent,\n configHttpAgent,\n allowEnvProxy = true\n) {\n let proxy = configProxy;\n const proxyEnvAgent = getProxyEnvAgent(options, configHttpAgent, configHttpsAgent);\n if (!proxy && proxy !== false && allowEnvProxy && !isNodeEnvProxyEnabled(proxyEnvAgent)) {\n const proxyUrl = getProxyForUrl(location);\n if (proxyUrl) {\n if (!shouldBypassProxy(location)) {\n proxy = new URL(proxyUrl);\n }\n }\n }\n // On redirect re-invocation, strip any stale Proxy-Authorization header carried\n // over from the prior request (e.g. new target no longer uses a proxy, or uses\n // a different proxy). Skip on the initial request so user-supplied headers are\n // preserved. Header names are case-insensitive, so remove every case variant.\n if (isRedirect && options.headers) {\n for (const name of Object.keys(options.headers)) {\n if (name.toLowerCase() === 'proxy-authorization') {\n delete options.headers[name];\n }\n }\n }\n // Strip any tunneling agent we installed for the previous hop so a redirect\n // that drops the proxy or crosses an HTTPS↔HTTP boundary doesn't reuse a\n //"} | |
| {"repo":"axios","file":"lib/adapters/http.js","line":622,"symbol":"request","kind":"method","lang":"javascript","code":"request(options, cb) {\n const authority =\n options.protocol +\n '//' +\n options.hostname +\n ':' +\n (options.port || (options.protocol === 'https:' ? 443 : 80));\n\n const { http2Options, headers } = options;\n\n const session = http2Sessions.getSession(authority, http2Options);\n\n const { HTTP2_HEADER_SCHEME, HTTP2_HEADER_METHOD, HTTP2_HEADER_PATH, HTTP2_HEADER_STATUS } =\n http2.constants;\n\n const http2Headers = {\n [HTTP2_HEADER_SCHEME]: options.protocol.replace(':', ''),\n [HTTP2_HEADER_METHOD]: options.method,\n [HTTP2_HEADER_PATH]: options.path,\n };\n\n utils.forEach(headers, (header, name) => {\n name.charAt(0) !== ':' && (http2Headers[name] = header);\n });\n\n const req = session.request(http2Headers);\n\n req.once('response', (responseHeaders) => {\n const response = req; //duplex\n\n responseHeaders = Object.assign({}, responseHeaders);\n\n const status = responseHeaders[HTTP2_HEADER_STATUS];\n\n delete responseHeaders[HTTP2_HEADER_STATUS];\n\n response.headers = responseHeaders;\n\n response.statusCode = +status;\n\n cb(response);\n });\n\n return req;\n }"} | |
| {"repo":"axios","file":"lib/adapters/http.js","line":737,"symbol":"abort","kind":"function","lang":"javascript","code":"function abort(reason) {\n try {\n abortEmitter.emit(\n 'abort',\n !reason || reason.type ? new CanceledError(null, config, req) : reason\n );\n } catch (err) {\n // ignore emit errors\n }\n }"} | |
| {"repo":"axios","file":"lib/adapters/http.js","line":748,"symbol":"clearConnectPhaseTimer","kind":"function","lang":"javascript","code":"function clearConnectPhaseTimer() {\n if (connectPhaseTimer) {\n clearTimeout(connectPhaseTimer);\n connectPhaseTimer = null;\n }\n }"} | |
| {"repo":"axios","file":"lib/adapters/http.js","line":755,"symbol":"createTimeoutError","kind":"function","lang":"javascript","code":"function createTimeoutError() {\n const configTimeout = own('timeout');\n let timeoutErrorMessage = configTimeout\n ? 'timeout of ' + configTimeout + 'ms exceeded'\n : 'timeout exceeded';\n const configTimeoutErrorMessage = own('timeoutErrorMessage');\n if (configTimeoutErrorMessage) {\n timeoutErrorMessage = configTimeoutErrorMessage;\n }\n return new AxiosError(\n timeoutErrorMessage,\n transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED,\n config,\n req\n );\n }"} | |
| {"repo":"axios","file":"lib/adapters/http.js","line":1572,"symbol":"transform","kind":"method","lang":"javascript","code":"transform(chunk, _enc, cb) {\n bytesSent += chunk.length;\n if (bytesSent > limit) {\n return cb(\n new AxiosError(\n 'Request body larger than maxBodyLength limit',\n AxiosError.ERR_BAD_REQUEST,\n config,\n req\n )\n );\n }\n cb(null, chunk);\n }"} | |
| {"repo":"axios","file":"lib/adapters/xhr.js","line":27,"symbol":"done","kind":"function","lang":"javascript","code":"function done() {\n flushUpload && flushUpload(); // flush events\n flushDownload && flushDownload(); // flush events\n\n _config.cancelToken && _config.cancelToken.unsubscribe(onCanceled);\n\n _config.signal && _config.signal.removeEventListener('abort', onCanceled);\n }"} | |
| {"repo":"axios","file":"lib/adapters/xhr.js","line":43,"symbol":"onloadend","kind":"function","lang":"javascript","code":"function onloadend(event) {\n if (!request) {\n return;\n }\n\n // Status 0 means no response was received, which onerror and onabort normally\n // reject before this runs. Firefox 152 fires only readystatechange and loadend for\n // navigation-canceled requests (https://bugzilla.mozilla.org/show_bug.cgi?id=1505389),\n // leaving settle() to resolve them as an empty success. ECONNABORTED is the error\n // onabort raised on Firefox 151. Reads over file:, which some environments report as\n // status 0 on success, are excluded by the request URL's scheme after browser-style\n // preprocessing, by the page origin's scheme for relative URLs (which inherit it), or\n // by responseURL where implemented.\n if (\n request.status === 0 &&\n (parseProtocol(normalizeURLForProtocolCheck(_config.url)) ||\n parseProtocol(platform.origin)) !== 'file' &&\n !(request.responseURL && request.responseURL.startsWith('file:'))\n ) {\n reject(new AxiosError('Request aborted', AxiosError.ECONNABORTED, config, request));\n done();\n\n // Clean up request\n request "} | |
| {"repo":"axios","file":"lib/axios.js","line":28,"symbol":"createInstance","kind":"function","lang":"javascript","doc":"Create an instance of Axios @param {Object} defaultConfig The default config for the instance @returns {Axios} A new instance of Axios","code":"function createInstance(defaultConfig) {\n const context = new Axios(defaultConfig);\n const instance = bind(Axios.prototype.request, context);\n\n // Copy axios.prototype to instance\n utils.extend(instance, Axios.prototype, context, { allOwnKeys: true });\n\n // Copy context to instance\n utils.extend(instance, context, null, { allOwnKeys: true });\n\n // Factory for creating new instances\n instance.create = function create(instanceConfig) {\n return createInstance(mergeConfig(defaultConfig, instanceConfig));\n };\n\n return instance;\n}"} | |
| {"repo":"axios","file":"lib/cancel/CancelToken.js","line":12,"symbol":"CancelToken","kind":"class","lang":"javascript","doc":"A `CancelToken` is an object that can be used to request cancellation of an operation. @param {Function} executor The executor function. @returns {CancelToken}","code":"class CancelToken {\n constructor(executor) {\n if (typeof executor !== 'function') {\n throw new TypeError('executor must be a function.');\n }\n\n let resolvePromise;\n\n this.promise = new Promise(function promiseExecutor(resolve) {\n resolvePromise = resolve;\n });\n\n const token = this;\n\n // eslint-disable-next-line func-names\n this.promise.then((cancel) => {\n if (!token._listeners) return;\n\n let i = token._listeners.length;\n\n while (i-- > 0) {\n token._listeners[i](cancel);\n }\n token._listeners = null;\n });\n\n // eslint-disable-next-line func-names\n this.promise.then = (onfulfilled) => {\n let _resolve;\n // eslint-disable-next-line func-names\n const promise = new Promise((resolve) => {\n token.subscribe(resolve);\n _resolve = resolve;\n }).then(onfulfilled);\n\n promise.cancel = function reject() {\n token.unsubscribe(_resolve);\n };\n\n return promise;\n };\n\n executor(function cancel(message, config, request) {\n if (token.reason) {\n // Cancellation has already been requested\n return;\n }\n\n token.reason = new CanceledError(message, conf"} | |
| {"repo":"axios","file":"lib/cancel/CancelToken.js","line":13,"symbol":"constructor","kind":"method","lang":"javascript","code":"constructor(executor) {\n if (typeof executor !== 'function') {\n throw new TypeError('executor must be a function.');\n }\n\n let resolvePromise;\n\n this.promise = new Promise(function promiseExecutor(resolve) {\n resolvePromise = resolve;\n });\n\n const token = this;\n\n // eslint-disable-next-line func-names\n this.promise.then((cancel) => {\n if (!token._listeners) return;\n\n let i = token._listeners.length;\n\n while (i-- > 0) {\n token._listeners[i](cancel);\n }\n token._listeners = null;\n });\n\n // eslint-disable-next-line func-names\n this.promise.then = (onfulfilled) => {\n let _resolve;\n // eslint-disable-next-line func-names\n const promise = new Promise((resolve) => {\n token.subscribe(resolve);\n _resolve = resolve;\n }).then(onfulfilled);\n\n promise.cancel = function reject() {\n token.unsubscribe(_resolve);\n };\n\n return promise;\n };\n\n executor(function cancel(message, config, request) {\n if (token.reason) {\n // Cancellation has already been requested\n return;\n }\n\n token.reason = new CanceledError(message, config, request);\n re"} | |
| {"repo":"axios","file":"lib/cancel/CancelToken.js","line":68,"symbol":"throwIfRequested","kind":"method","lang":"javascript","doc":"Throws a `CanceledError` if cancellation has been requested.","code":"throwIfRequested() {\n if (this.reason) {\n throw this.reason;\n }\n }"} | |
| {"repo":"axios","file":"lib/cancel/CancelToken.js","line":78,"symbol":"subscribe","kind":"method","lang":"javascript","code":"subscribe(listener) {\n if (this.reason) {\n listener(this.reason);\n return;\n }\n\n if (this._listeners) {\n this._listeners.push(listener);\n } else {\n this._listeners = [listener];\n }\n }"} | |
| {"repo":"axios","file":"lib/cancel/CancelToken.js","line":95,"symbol":"unsubscribe","kind":"method","lang":"javascript","code":"unsubscribe(listener) {\n if (!this._listeners) {\n return;\n }\n const index = this._listeners.indexOf(listener);\n if (index !== -1) {\n this._listeners.splice(index, 1);\n }\n }"} | |
| {"repo":"axios","file":"lib/cancel/CancelToken.js","line":105,"symbol":"toAbortSignal","kind":"method","lang":"javascript","code":"toAbortSignal() {\n const controller = new AbortController();\n\n const abort = (err) => {\n controller.abort(err);\n };\n\n this.subscribe(abort);\n\n controller.signal.unsubscribe = () => this.unsubscribe(abort);\n\n return controller.signal;\n }"} | |
| {"repo":"axios","file":"lib/cancel/CancelToken.js","line":123,"symbol":"source","kind":"method","lang":"javascript","doc":"Returns an object that contains a new `CancelToken` and a function that, when called, cancels the `CancelToken`.","code":"static source() {\n let cancel;\n const token = new CancelToken(function executor(c) {\n cancel = c;\n });\n return {\n token,\n cancel,\n };\n }"} | |
| {"repo":"axios","file":"lib/cancel/CanceledError.js","line":5,"symbol":"CanceledError","kind":"class","lang":"javascript","code":"class CanceledError extends AxiosError {\n /**\n * A `CanceledError` is an object that is thrown when an operation is canceled.\n *\n * @param {string=} message The message.\n * @param {Object=} config The config.\n * @param {Object=} request The request.\n *\n * @returns {CanceledError} The created error.\n */\n constructor(message, config, request) {\n super(message == null ? 'canceled' : message, AxiosError.ERR_CANCELED, config, request);\n this.name = 'CanceledError';\n this.__CANCEL__ = true;\n }\n}"} | |
| {"repo":"axios","file":"lib/cancel/CanceledError.js","line":15,"symbol":"constructor","kind":"method","lang":"javascript","doc":"@param {string=} message The message. @param {Object=} config The config. @param {Object=} request The request. @returns {CanceledError} The created error.","code":"constructor(message, config, request) {\n super(message == null ? 'canceled' : message, AxiosError.ERR_CANCELED, config, request);\n this.name = 'CanceledError';\n this.__CANCEL__ = true;\n }"} | |
| {"repo":"axios","file":"lib/cancel/isCancel.js","line":3,"symbol":"isCancel","kind":"function","lang":"javascript","code":"function isCancel(value) {\n return !!(value && value.__CANCEL__);\n}"} | |
| {"repo":"axios","file":"lib/core/Axios.js","line":23,"symbol":"Axios","kind":"class","lang":"javascript","doc":"Create a new instance of Axios @param {Object} instanceConfig The default config for the instance @return {Axios} A new instance of Axios","code":"class Axios {\n constructor(instanceConfig) {\n this.defaults = instanceConfig || {};\n this.interceptors = {\n request: new InterceptorManager(),\n response: new InterceptorManager(),\n };\n }\n\n /**\n * Dispatch a request\n *\n * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults)\n * @param {?Object} config\n *\n * @returns {Promise} The Promise to be fulfilled\n */\n async request(configOrUrl, config) {\n try {\n return await this._request(configOrUrl, config);\n } catch (err) {\n if (err instanceof Error) {\n try {\n let dummy = {};\n\n Error.captureStackTrace ? Error.captureStackTrace(dummy) : (dummy = new Error());\n\n const dummyStack = dummy.stack;\n let stack = '';\n\n // slice off the Error: ... line\n if (typeof dummyStack === 'string') {\n const firstNewlineIndex = dummyStack.indexOf('\\n');\n\n stack = firstNewlineIndex === -1 ? '' : dummyStack.slice(firstNewlineIndex + 1);\n }\n\n if (!err.stack) {\n err.stack = stack;\n // match without the 2 top stack lines\n } else if (stack"} | |
| {"repo":"axios","file":"lib/core/Axios.js","line":24,"symbol":"constructor","kind":"method","lang":"javascript","code":"constructor(instanceConfig) {\n this.defaults = instanceConfig || {};\n this.interceptors = {\n request: new InterceptorManager(),\n response: new InterceptorManager(),\n };\n }"} | |
| {"repo":"axios","file":"lib/core/Axios.js","line":40,"symbol":"request","kind":"method","lang":"javascript","doc":"@param {String|Object} configOrUrl The config specific for this request (merged with this.defaults) @param {?Object} config @returns {Promise} The Promise to be fulfilled","code":"async request(configOrUrl, config) {\n try {\n return await this._request(configOrUrl, config);\n } catch (err) {\n if (err instanceof Error) {\n try {\n let dummy = {};\n\n Error.captureStackTrace ? Error.captureStackTrace(dummy) : (dummy = new Error());\n\n const dummyStack = dummy.stack;\n let stack = '';\n\n // slice off the Error: ... line\n if (typeof dummyStack === 'string') {\n const firstNewlineIndex = dummyStack.indexOf('\\n');\n\n stack = firstNewlineIndex === -1 ? '' : dummyStack.slice(firstNewlineIndex + 1);\n }\n\n if (!err.stack) {\n err.stack = stack;\n // match without the 2 top stack lines\n } else if (stack) {\n const firstNewlineIndex = stack.indexOf('\\n');\n const secondNewlineIndex =\n firstNewlineIndex === -1 ? -1 : stack.indexOf('\\n', firstNewlineIndex + 1);\n const stackWithoutTwoTopLines =\n secondNewlineIndex === -1 ? '' : stack.slice(secondNewlineIndex + 1);\n\n if (!String(err.stack).endsWith(stackWithoutTwoTopLines)) {\n err.stack += '\\n' + stack;\n "} | |
| {"repo":"axios","file":"lib/core/Axios.js","line":83,"symbol":"_request","kind":"method","lang":"javascript","code":"_request(configOrUrl, config) {\n /*eslint no-param-reassign:0*/\n // Allow for axios('example/url'[, config]) a la fetch API\n if (typeof configOrUrl === 'string') {\n config = config || {};\n config.url = configOrUrl;\n } else {\n config = configOrUrl || {};\n }\n\n config = mergeConfig(this.defaults, config);\n\n const { transitional, paramsSerializer, headers } = config;\n\n if (transitional !== undefined) {\n validator.assertOptions(\n transitional,\n {\n silentJSONParsing: validators.transitional(validators.boolean),\n forcedJSONParsing: validators.transitional(validators.boolean),\n clarifyTimeoutError: validators.transitional(validators.boolean),\n legacyInterceptorReqResOrdering: validators.transitional(validators.boolean),\n advertiseZstdAcceptEncoding: validators.transitional(validators.boolean),\n validateStatusUndefinedResolves: validators.transitional(validators.boolean),\n },\n false\n );\n }\n\n if (paramsSerializer != null) {\n if (utils.isFunction(paramsSerializer)) {\n config.paramsSerializer = {\n serialize: paramsSerializer,\n };\n "} | |
| {"repo":"axios","file":"lib/core/Axios.js","line":261,"symbol":"getUri","kind":"method","lang":"javascript","code":"getUri(config) {\n config = mergeConfig(this.defaults, config);\n const fullPath = buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls, config);\n return buildURL(fullPath, config.params, config.paramsSerializer);\n }"} | |
| {"repo":"axios","file":"lib/core/Axios.js","line":283,"symbol":"generateHTTPMethod","kind":"function","lang":"javascript","code":"function generateHTTPMethod(isForm) {\n return async function httpMethod(url, data, config) {\n return this.request(\n mergeConfig(config || {}, {\n method,\n headers: isForm\n ? {\n 'Content-Type': 'multipart/form-data',\n }\n : {},\n url,\n data,\n })\n );\n };\n }"} | |
| {"repo":"axios","file":"lib/core/AxiosError.js","line":8,"symbol":"hasOwnOrPrototypeToJSON","kind":"function","lang":"javascript","code":"function hasOwnOrPrototypeToJSON(source) {\n if (utils.hasOwnProp(source, 'toJSON')) {\n return true;\n }\n\n let prototype = Object.getPrototypeOf(source);\n\n while (prototype && prototype !== Object.prototype) {\n if (utils.hasOwnProp(prototype, 'toJSON')) {\n return true;\n }\n\n prototype = Object.getPrototypeOf(prototype);\n }\n\n return false;\n}"} | |
| {"repo":"axios","file":"lib/core/AxiosError.js","line":29,"symbol":"redactConfig","kind":"function","lang":"javascript","doc":"Build a plain-object snapshot of `config` and replace the value of any key (case-insensitive) listed in `redactKeys` with REDACTED. Walks through arrays and AxiosHeaders, and short-circuits on circular references.","code":"function redactConfig(config, redactKeys) {\n const lowerKeys = new Set(redactKeys.map((k) => String(k).toLowerCase()));\n const seen = [];\n\n const visit = (source) => {\n if (source === null || typeof source !== 'object') return source;\n if (utils.isBuffer(source)) return source;\n if (seen.indexOf(source) !== -1) return undefined;\n\n if (source instanceof AxiosHeaders) {\n source = source.toJSON();\n }\n\n seen.push(source);\n\n let result;\n if (utils.isArray(source)) {\n result = [];\n source.forEach((v, i) => {\n const reducedValue = visit(v);\n if (!utils.isUndefined(reducedValue)) {\n result[i] = reducedValue;\n }\n });\n } else {\n if (!utils.isPlainObject(source) && hasOwnOrPrototypeToJSON(source)) {\n seen.pop();\n return source;\n }\n\n result = Object.create(null);\n for (const [key, value] of Object.entries(source)) {\n const reducedValue = lowerKeys.has(key.toLowerCase()) ? REDACTED : visit(value);\n if (!utils.isUndefined(reducedValue)) {\n result[key] = reducedValue;\n }\n }\n }\n\n seen.pop();\n return result;\n };\n\n return visit(config);\n}"} | |
| {"repo":"axios","file":"lib/core/AxiosError.js","line":75,"symbol":"stringifySafely","kind":"function","lang":"javascript","code":"function stringifySafely(value) {\n try {\n return String(value);\n } catch (err) {\n return '';\n }\n}"} | |
| {"repo":"axios","file":"lib/core/AxiosError.js","line":83,"symbol":"aggregateErrorMessage","kind":"function","lang":"javascript","code":"function aggregateErrorMessage(error) {\n const message = error.errors\n .map((entry) => {\n try {\n return entry && entry.message ? stringifySafely(entry.message) : stringifySafely(entry);\n } catch (err) {\n return '';\n }\n })\n .filter(Boolean)\n .join('; ');\n\n return message || error.name || 'AggregateError';\n}"} | |
| {"repo":"axios","file":"lib/core/AxiosError.js","line":98,"symbol":"AxiosError","kind":"class","lang":"javascript","code":"class AxiosError extends Error {\n static from(error, code, config, request, response, customProps) {\n // `AggregateError` (thrown by Node on dual-stack/Happy-Eyeballs connection\n // failures) has an empty `message`; its detail lives in `errors[]`. Without\n // this, the wrapped error surfaces with a blank message (see #6721).\n let message = error.message;\n if (!message && utils.isArray(error.errors) && error.errors.length) {\n message = aggregateErrorMessage(error);\n }\n\n const axiosError = new AxiosError(message, code || error.code, config, request, response);\n // Match native `Error` `cause` semantics: non-enumerable. The wrapped\n // error often carries circular internals (sockets, requests, agents), so\n // an enumerable `cause` makes structured loggers (pino/winston) and any\n // own-property walk throw \"Converting circular structure to JSON\".\n // Regression from #6982; see #7205. `__proto__: null` mirrors the\n // `message` descriptor below (prototype-pollution-safe descriptor).\n Object.defineProperty(axiosError, 'cause', {\n __proto__: null,\n value: error,\n writable: true,\n enumerable: false,\n configurable: tru"} | |
| {"repo":"axios","file":"lib/core/AxiosError.js","line":99,"symbol":"from","kind":"method","lang":"javascript","code":"static from(error, code, config, request, response, customProps) {\n // `AggregateError` (thrown by Node on dual-stack/Happy-Eyeballs connection\n // failures) has an empty `message`; its detail lives in `errors[]`. Without\n // this, the wrapped error surfaces with a blank message (see #6721).\n let message = error.message;\n if (!message && utils.isArray(error.errors) && error.errors.length) {\n message = aggregateErrorMessage(error);\n }\n\n const axiosError = new AxiosError(message, code || error.code, config, request, response);\n // Match native `Error` `cause` semantics: non-enumerable. The wrapped\n // error often carries circular internals (sockets, requests, agents), so\n // an enumerable `cause` makes structured loggers (pino/winston) and any\n // own-property walk throw \"Converting circular structure to JSON\".\n // Regression from #6982; see #7205. `__proto__: null` mirrors the\n // `message` descriptor below (prototype-pollution-safe descriptor).\n Object.defineProperty(axiosError, 'cause', {\n __proto__: null,\n value: error,\n writable: true,\n enumerable: false,\n configurable: true,\n });\n axiosError.name = er"} | |
| {"repo":"axios","file":"lib/core/AxiosError.js","line":144,"symbol":"constructor","kind":"method","lang":"javascript","doc":"@param {Object} [config] The config. @param {Object} [request] The request. @param {Object} [response] The response. @returns {Error} The created error.","code":"constructor(message, code, config, request, response) {\n super(message);\n\n // Make message enumerable to maintain backward compatibility\n // The native Error constructor sets message as non-enumerable,\n // but axios < v1.13.3 had it as enumerable\n Object.defineProperty(this, 'message', {\n // Null-proto descriptor so a polluted Object.prototype.get cannot turn\n // this data descriptor into an accessor descriptor on the way in.\n __proto__: null,\n value: message,\n enumerable: true,\n writable: true,\n configurable: true,\n });\n\n this.name = 'AxiosError';\n this.isAxiosError = true;\n code && (this.code = code);\n config && (this.config = config);\n request && (this.request = request);\n if (response) {\n this.response = response;\n this.status = response.status;\n }\n }"} | |
| {"repo":"axios","file":"lib/core/AxiosError.js","line":171,"symbol":"toJSON","kind":"method","lang":"javascript","code":"toJSON() {\n // Opt-in redaction: when the request config carries a `redact` array, the\n // value of any matching key (case-insensitive, at any depth) is replaced\n // with REDACTED in the serialized snapshot. Undefined or empty leaves the\n // existing serialization behavior unchanged.\n const config = this.config;\n const redactKeys = config && utils.hasOwnProp(config, 'redact') ? config.redact : undefined;\n const serializedConfig =\n utils.isArray(redactKeys) && redactKeys.length > 0\n ? redactConfig(config, redactKeys)\n : utils.toJSONObject(config);\n\n return {\n // Standard\n message: this.message,\n name: this.name,\n // Microsoft\n description: this.description,\n number: this.number,\n // Mozilla\n fileName: this.fileName,\n lineNumber: this.lineNumber,\n columnNumber: this.columnNumber,\n stack: this.stack,\n // Axios\n config: serializedConfig,\n code: this.code,\n status: this.status,\n };\n }"} | |
| {"repo":"axios","file":"lib/core/AxiosHeaders.js","line":9,"symbol":"normalizeHeader","kind":"function","lang":"javascript","code":"function normalizeHeader(header) {\n return header && String(header).trim().toLowerCase();\n}"} | |
| {"repo":"axios","file":"lib/core/AxiosHeaders.js","line":13,"symbol":"normalizeValue","kind":"function","lang":"javascript","code":"function normalizeValue(value) {\n if (value === false || value == null) {\n return value;\n }\n\n return utils.isArray(value) ? value.map(normalizeValue) : sanitizeHeaderValue(String(value));\n}"} | |
| {"repo":"axios","file":"lib/core/AxiosHeaders.js","line":21,"symbol":"parseTokens","kind":"function","lang":"javascript","code":"function parseTokens(str) {\n const tokens = Object.create(null);\n const tokensRE = /([^\\s,;=]+)\\s*(?:=\\s*([^,;]+))?/g;\n let match;\n\n while ((match = tokensRE.exec(str))) {\n tokens[match[1]] = match[2];\n }\n\n return tokens;\n}"} | |
| {"repo":"axios","file":"lib/core/AxiosHeaders.js","line":35,"symbol":"trimOWS","kind":"function","lang":"javascript","code":"function trimOWS(value) {\n let start = 0;\n let end = value.length;\n\n while (start < end) {\n const code = value.charCodeAt(start);\n\n if (code !== 0x09 && code !== 0x20) {\n break;\n }\n\n start += 1;\n }\n\n while (end > start) {\n const code = value.charCodeAt(end - 1);\n\n if (code !== 0x09 && code !== 0x20) {\n break;\n }\n\n end -= 1;\n }\n\n return start === 0 && end === value.length ? value : value.slice(start, end);\n}"} | |
| {"repo":"axios","file":"lib/core/AxiosHeaders.js","line":62,"symbol":"decodeQuotedString","kind":"function","lang":"javascript","code":"function decodeQuotedString(value) {\n const last = value.length - 1;\n\n if (last < 1 || value.charCodeAt(0) !== 0x22 || value.charCodeAt(last) !== 0x22) {\n return value;\n }\n\n let decoded = '';\n\n for (let i = 1; i < last; i++) {\n const code = value.charCodeAt(i);\n\n if (code === 0x22) {\n return value;\n }\n\n if (code === 0x5c) {\n i += 1;\n\n if (i >= last) {\n return value;\n }\n }\n\n decoded += value[i];\n }\n\n return decoded;\n}"} | |
| {"repo":"axios","file":"lib/core/AxiosHeaders.js","line":92,"symbol":"parseParameters","kind":"function","lang":"javascript","code":"function parseParameters(value) {\n const parameters = Object.create(null);\n const str = String(value);\n let start = 0;\n let quoted = false;\n let escaped = false;\n\n function parseParameter(end) {\n const part = trimOWS(str.slice(start, end));\n const equals = part.indexOf('=');\n\n if (equals < 1) {\n return;\n }\n\n const name = trimOWS(part.slice(0, equals));\n\n if (!parameterNameRE.test(name)) {\n return;\n }\n\n const normalizedName = name.toLowerCase();\n\n if (\n normalizedName === '__proto__' ||\n normalizedName === 'constructor' ||\n normalizedName === 'prototype'\n ) {\n return;\n }\n\n const parameterValue = trimOWS(part.slice(equals + 1));\n parameters[normalizedName] = decodeQuotedString(parameterValue);\n }\n\n for (let i = 0; i < str.length; i++) {\n const code = str.charCodeAt(i);\n\n if (quoted) {\n if (escaped) {\n escaped = false;\n } else if (code === 0x5c) {\n escaped = true;\n } else if (code === 0x22) {\n quoted = false;\n }\n } else if (code === 0x22) {\n quoted = true;\n } else if (code === 0x2c || code === 0x3b) {\n parseParameter(i);\n start = i + 1;\n }"} | |
| {"repo":"axios","file":"lib/core/AxiosHeaders.js","line":99,"symbol":"parseParameter","kind":"function","lang":"javascript","code":"function parseParameter(end) {\n const part = trimOWS(str.slice(start, end));\n const equals = part.indexOf('=');\n\n if (equals < 1) {\n return;\n }\n\n const name = trimOWS(part.slice(0, equals));\n\n if (!parameterNameRE.test(name)) {\n return;\n }\n\n const normalizedName = name.toLowerCase();\n\n if (\n normalizedName === '__proto__' ||\n normalizedName === 'constructor' ||\n normalizedName === 'prototype'\n ) {\n return;\n }\n\n const parameterValue = trimOWS(part.slice(equals + 1));\n parameters[normalizedName] = decodeQuotedString(parameterValue);\n }"} | |
| {"repo":"axios","file":"lib/core/AxiosHeaders.js","line":153,"symbol":"matchHeaderValue","kind":"function","lang":"javascript","code":"function matchHeaderValue(context, value, header, filter, isHeaderNameFilter) {\n if (utils.isFunction(filter)) {\n return filter.call(this, value, header);\n }\n\n if (isHeaderNameFilter) {\n value = header;\n }\n\n if (!utils.isString(value)) return;\n\n if (utils.isString(filter)) {\n return value.indexOf(filter) !== -1;\n }\n\n if (utils.isRegExp(filter)) {\n return filter.test(value);\n }\n}"} | |
| {"repo":"axios","file":"lib/core/AxiosHeaders.js","line":173,"symbol":"formatHeader","kind":"function","lang":"javascript","code":"function formatHeader(header) {\n return header\n .trim()\n .toLowerCase()\n .replace(/([a-z\\d])(\\w*)/g, (w, char, str) => {\n return char.toUpperCase() + str;\n });\n}"} | |
| {"repo":"axios","file":"lib/core/AxiosHeaders.js","line":182,"symbol":"buildAccessors","kind":"function","lang":"javascript","code":"function buildAccessors(obj, header) {\n const accessorName = utils.toCamelCase(' ' + header);\n\n ['get', 'set', 'has'].forEach((methodName) => {\n Object.defineProperty(obj, methodName + accessorName, {\n // Null-proto descriptor so a polluted Object.prototype.get cannot turn\n // this data descriptor into an accessor descriptor on the way in.\n __proto__: null,\n value: function (arg1, arg2, arg3) {\n return this[methodName].call(this, header, arg1, arg2, arg3);\n },\n configurable: true,\n });\n });\n}"} | |
| {"repo":"axios","file":"lib/core/AxiosHeaders.js","line":198,"symbol":"AxiosHeaders","kind":"class","lang":"javascript","code":"class AxiosHeaders {\n constructor(headers) {\n headers && this.set(headers);\n }\n\n set(header, valueOrRewrite, rewrite) {\n const self = this;\n\n function setHeader(_value, _header, _rewrite) {\n const lHeader = normalizeHeader(_header);\n\n if (!lHeader) {\n return;\n }\n\n const key = utils.findKey(self, lHeader);\n\n if (\n !key ||\n self[key] === undefined ||\n _rewrite === true ||\n (_rewrite === undefined && self[key] !== false)\n ) {\n self[key || _header] = normalizeValue(_value);\n }\n }\n\n const setHeaders = (headers, _rewrite) =>\n utils.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));\n\n if (utils.isPlainObject(header) || header instanceof this.constructor) {\n setHeaders(header, valueOrRewrite);\n } else if (utils.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {\n setHeaders(parseHeaders(header), valueOrRewrite);\n } else if (utils.isObject(header) && utils.isSafeIterable(header)) {\n let obj = Object.create(null),\n dest,\n key;\n for (const entry of header) {\n if (!utils.isArray(entry)) {\n "} | |
| {"repo":"axios","file":"lib/core/AxiosHeaders.js","line":199,"symbol":"constructor","kind":"method","lang":"javascript","code":"constructor(headers) {\n headers && this.set(headers);\n }"} | |
| {"repo":"axios","file":"lib/core/AxiosHeaders.js","line":203,"symbol":"set","kind":"method","lang":"javascript","code":"set(header, valueOrRewrite, rewrite) {\n const self = this;\n\n function setHeader(_value, _header, _rewrite) {\n const lHeader = normalizeHeader(_header);\n\n if (!lHeader) {\n return;\n }\n\n const key = utils.findKey(self, lHeader);\n\n if (\n !key ||\n self[key] === undefined ||\n _rewrite === true ||\n (_rewrite === undefined && self[key] !== false)\n ) {\n self[key || _header] = normalizeValue(_value);\n }\n }\n\n const setHeaders = (headers, _rewrite) =>\n utils.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));\n\n if (utils.isPlainObject(header) || header instanceof this.constructor) {\n setHeaders(header, valueOrRewrite);\n } else if (utils.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {\n setHeaders(parseHeaders(header), valueOrRewrite);\n } else if (utils.isObject(header) && utils.isSafeIterable(header)) {\n let obj = Object.create(null),\n dest,\n key;\n for (const entry of header) {\n if (!utils.isArray(entry)) {\n throw new TypeError('Object iterator must return a key-value pair');\n }\n\n "} | |
| {"repo":"axios","file":"lib/core/AxiosHeaders.js","line":206,"symbol":"setHeader","kind":"function","lang":"javascript","code":"function setHeader(_value, _header, _rewrite) {\n const lHeader = normalizeHeader(_header);\n\n if (!lHeader) {\n return;\n }\n\n const key = utils.findKey(self, lHeader);\n\n if (\n !key ||\n self[key] === undefined ||\n _rewrite === true ||\n (_rewrite === undefined && self[key] !== false)\n ) {\n self[key || _header] = normalizeValue(_value);\n }\n }"} | |
| {"repo":"axios","file":"lib/core/AxiosHeaders.js","line":259,"symbol":"get","kind":"method","lang":"javascript","code":"get(header, parser) {\n header = normalizeHeader(header);\n\n if (header) {\n const key = utils.findKey(this, header);\n\n if (key) {\n const value = this[key];\n\n if (!parser) {\n return value;\n }\n\n if (parser === true) {\n return parseTokens(value);\n }\n\n if (utils.isFunction(parser)) {\n return parser.call(this, value, key);\n }\n\n if (utils.isRegExp(parser)) {\n return parser.exec(value);\n }\n\n throw new TypeError('parser must be boolean|regexp|function');\n }\n }\n }"} | |
| {"repo":"axios","file":"lib/core/AxiosHeaders.js","line":289,"symbol":"has","kind":"method","lang":"javascript","code":"has(header, matcher) {\n header = normalizeHeader(header);\n\n if (header) {\n const key = utils.findKey(this, header);\n\n return !!(\n key &&\n this[key] !== undefined &&\n (!matcher || matchHeaderValue(this, this[key], key, matcher))\n );\n }\n\n return false;\n }"} | |
| {"repo":"axios","file":"lib/core/AxiosHeaders.js","line":305,"symbol":"delete","kind":"method","lang":"javascript","code":"delete(header, matcher) {\n const self = this;\n let deleted = false;\n\n function deleteHeader(_header) {\n _header = normalizeHeader(_header);\n\n if (_header) {\n const key = utils.findKey(self, _header);\n\n if (key && (!matcher || matchHeaderValue(self, self[key], key, matcher))) {\n delete self[key];\n\n deleted = true;\n }\n }\n }\n\n if (utils.isArray(header)) {\n header.forEach(deleteHeader);\n } else {\n deleteHeader(header);\n }\n\n return deleted;\n }"} | |
| {"repo":"axios","file":"lib/core/AxiosHeaders.js","line":309,"symbol":"deleteHeader","kind":"function","lang":"javascript","code":"function deleteHeader(_header) {\n _header = normalizeHeader(_header);\n\n if (_header) {\n const key = utils.findKey(self, _header);\n\n if (key && (!matcher || matchHeaderValue(self, self[key], key, matcher))) {\n delete self[key];\n\n deleted = true;\n }\n }\n }"} | |
| {"repo":"axios","file":"lib/core/AxiosHeaders.js","line":332,"symbol":"clear","kind":"method","lang":"javascript","code":"clear(matcher) {\n const keys = Object.keys(this);\n let i = keys.length;\n let deleted = false;\n\n while (i--) {\n const key = keys[i];\n if (!matcher || matchHeaderValue(this, this[key], key, matcher, true)) {\n delete this[key];\n deleted = true;\n }\n }\n\n return deleted;\n }"} | |
| {"repo":"axios","file":"lib/core/AxiosHeaders.js","line":348,"symbol":"normalize","kind":"method","lang":"javascript","code":"normalize(format) {\n const self = this;\n const headers = {};\n\n utils.forEach(this, (value, header) => {\n const key = utils.findKey(headers, header);\n\n if (key) {\n self[key] = normalizeValue(value);\n delete self[header];\n return;\n }\n\n const normalized = format ? formatHeader(header) : String(header).trim();\n\n if (normalized !== header) {\n delete self[header];\n }\n\n self[normalized] = normalizeValue(value);\n\n headers[normalized] = true;\n });\n\n return this;\n }"} | |
| {"repo":"axios","file":"lib/core/AxiosHeaders.js","line":375,"symbol":"concat","kind":"method","lang":"javascript","code":"concat(...targets) {\n return this.constructor.concat(this, ...targets);\n }"} | |
| {"repo":"axios","file":"lib/core/AxiosHeaders.js","line":379,"symbol":"toJSON","kind":"method","lang":"javascript","code":"toJSON(asStrings) {\n const obj = Object.create(null);\n\n utils.forEach(this, (value, header) => {\n value != null &&\n value !== false &&\n (obj[header] = asStrings && utils.isArray(value) ? value.join(', ') : value);\n });\n\n return obj;\n }"} | |
| {"repo":"axios","file":"lib/core/AxiosHeaders.js","line":395,"symbol":"toString","kind":"method","lang":"javascript","code":"toString() {\n return Object.entries(this.toJSON())\n .map(([header, value]) => header + ': ' + value)\n .join('\\n');\n }"} | |
| {"repo":"axios","file":"lib/core/AxiosHeaders.js","line":401,"symbol":"getSetCookie","kind":"method","lang":"javascript","code":"getSetCookie() {\n const value = this.get('set-cookie');\n return utils.isArray(value) ? value : value == null || value === false ? [] : [value];\n }"} | |
| {"repo":"axios","file":"lib/core/AxiosHeaders.js","line":410,"symbol":"from","kind":"method","lang":"javascript","code":"static from(thing) {\n return thing instanceof this ? thing : new this(thing);\n }"} | |
| {"repo":"axios","file":"lib/core/AxiosHeaders.js","line":414,"symbol":"parseParameters","kind":"method","lang":"javascript","code":"static parseParameters(value) {\n return parseParameters(value);\n }"} | |
| {"repo":"axios","file":"lib/core/AxiosHeaders.js","line":418,"symbol":"concat","kind":"method","lang":"javascript","code":"static concat(first, ...targets) {\n const computed = new this(first);\n\n targets.forEach((target) => computed.set(target));\n\n return computed;\n }"} | |
| {"repo":"axios","file":"lib/core/AxiosHeaders.js","line":426,"symbol":"accessor","kind":"method","lang":"javascript","code":"static accessor(header) {\n const internals =\n (this[$internals] =\n this[$internals] =\n {\n accessors: {},\n });\n\n const accessors = internals.accessors;\n const prototype = this.prototype;\n\n function defineAccessor(_header) {\n const lHeader = normalizeHeader(_header);\n\n if (!accessors[lHeader]) {\n buildAccessors(prototype, _header);\n accessors[lHeader] = true;\n }\n }\n\n utils.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);\n\n return this;\n }"} | |
| {"repo":"axios","file":"lib/core/AxiosHeaders.js","line":437,"symbol":"defineAccessor","kind":"function","lang":"javascript","code":"function defineAccessor(_header) {\n const lHeader = normalizeHeader(_header);\n\n if (!accessors[lHeader]) {\n buildAccessors(prototype, _header);\n accessors[lHeader] = true;\n }\n }"} | |
| {"repo":"axios","file":"lib/core/AxiosHeaders.js","line":466,"symbol":"set","kind":"method","lang":"javascript","code":"set(headerValue) {\n this[mapped] = headerValue;\n }"} | |
| {"repo":"axios","file":"lib/core/InterceptorManager.js","line":10,"symbol":"countHandlers","kind":"function","lang":"javascript","doc":"`handlers` is public and may be replaced with a nullish value by user code; `clear()` has always tolerated that. Treat it as an empty stack rather than dereferencing it.","code":"function countHandlers(handlers) {\n return handlers ? handlers.length : 0;\n}"} | |
| {"repo":"axios","file":"lib/core/InterceptorManager.js","line":14,"symbol":"trimHandlers","kind":"function","lang":"javascript","code":"function trimHandlers(handlers) {\n if (!handlers) {\n return;\n }\n\n while (handlers.length && handlers[handlers.length - 1] === null) {\n handlers.pop();\n }\n}"} | |
| {"repo":"axios","file":"lib/core/InterceptorManager.js","line":24,"symbol":"syncHandlerEntries","kind":"function","lang":"javascript","code":"function syncHandlerEntries(manager, internals) {\n const handlers = manager.handlers;\n const length = countHandlers(handlers);\n\n if (handlers !== internals.handlersRef) {\n internals.handlersRef = handlers;\n internals.handlerEntries.clear();\n } else if (length !== internals.handlersLength) {\n if (!length) {\n internals.handlerEntries.clear();\n } else {\n internals.handlerEntries.forEach(function removeStaleEntry(entry, id) {\n if (handlers[entry.index] !== entry.handler) {\n internals.handlerEntries.delete(id);\n }\n });\n }\n }\n\n internals.handlersLength = length;\n}"} | |
| {"repo":"axios","file":"lib/core/InterceptorManager.js","line":46,"symbol":"InterceptorManager","kind":"class","lang":"javascript","code":"class InterceptorManager {\n constructor() {\n this.handlers = [];\n this[$internals] = {\n handlersRef: this.handlers,\n handlersLength: this.handlers.length,\n handlerEntries: new Map(),\n iterationDepth: 0,\n nextId: 0,\n };\n }\n\n /**\n * Add a new interceptor to the stack\n *\n * @param {Function} fulfilled The function to handle `then` for a `Promise`\n * @param {Function} rejected The function to handle `reject` for a `Promise`\n * @param {Object} options The options for the interceptor, synchronous and runWhen\n *\n * @return {Number} An ID used to remove interceptor later\n */\n use(fulfilled, rejected, options) {\n const handler = {\n fulfilled,\n rejected,\n synchronous: options ? options.synchronous : false,\n runWhen: options ? options.runWhen : null,\n };\n const internals = this[$internals];\n\n if (this.handlers == null) {\n this.handlers = [];\n }\n\n syncHandlerEntries(this, internals);\n\n const id = internals.nextId++;\n\n this.handlers.push(handler);\n internals.handlerEntries.set(id, {\n handler,\n index: this.handlers.length - 1,\n });\n internals.handlersLength = this.handlers.le"} | |
| {"repo":"axios","file":"lib/core/InterceptorManager.js","line":47,"symbol":"constructor","kind":"method","lang":"javascript","code":"constructor() {\n this.handlers = [];\n this[$internals] = {\n handlersRef: this.handlers,\n handlersLength: this.handlers.length,\n handlerEntries: new Map(),\n iterationDepth: 0,\n nextId: 0,\n };\n }"} | |
| {"repo":"axios","file":"lib/core/InterceptorManager.js","line":67,"symbol":"use","kind":"method","lang":"javascript","doc":"@param {Function} fulfilled The function to handle `then` for a `Promise` @param {Function} rejected The function to handle `reject` for a `Promise` @param {Object} options The options for the interceptor, synchronous and runWhen @return {Number} An ID used to remove interceptor later","code":"use(fulfilled, rejected, options) {\n const handler = {\n fulfilled,\n rejected,\n synchronous: options ? options.synchronous : false,\n runWhen: options ? options.runWhen : null,\n };\n const internals = this[$internals];\n\n if (this.handlers == null) {\n this.handlers = [];\n }\n\n syncHandlerEntries(this, internals);\n\n const id = internals.nextId++;\n\n this.handlers.push(handler);\n internals.handlerEntries.set(id, {\n handler,\n index: this.handlers.length - 1,\n });\n internals.handlersLength = this.handlers.length;\n\n return id;\n }"} | |
| {"repo":"axios","file":"lib/core/InterceptorManager.js","line":101,"symbol":"eject","kind":"method","lang":"javascript","doc":"Remove an interceptor from the stack @param {Number} id The ID that was returned by `use` @returns {void}","code":"eject(id) {\n const internals = this[$internals];\n\n syncHandlerEntries(this, internals);\n\n const entry = internals.handlerEntries.get(id);\n\n if (entry) {\n internals.handlerEntries.delete(id);\n\n // Ignore IDs invalidated by clear or direct replacement of handlers.\n if (this.handlers[entry.index] !== entry.handler) {\n return;\n }\n\n this.handlers[entry.index] = null;\n\n // Do not reuse an index while forEach is walking its length snapshot.\n if (!internals.iterationDepth) {\n trimHandlers(this.handlers);\n internals.handlersLength = this.handlers.length;\n }\n }\n }"} | |
| {"repo":"axios","file":"lib/core/InterceptorManager.js","line":131,"symbol":"clear","kind":"method","lang":"javascript","doc":"Clear all interceptors from the stack @returns {void}","code":"clear() {\n if (this.handlers) {\n this.handlers = [];\n syncHandlerEntries(this, this[$internals]);\n }\n }"} | |
| {"repo":"axios","file":"lib/core/InterceptorManager.js","line":148,"symbol":"forEach","kind":"method","lang":"javascript","doc":"interceptors that may have become `null` calling `eject`. @param {Function} fn The function to call for each interceptor @returns {void}","code":"forEach(fn) {\n const internals = this[$internals];\n\n syncHandlerEntries(this, internals);\n\n internals.iterationDepth++;\n\n try {\n utils.forEach(this.handlers, function forEachHandler(h) {\n if (h !== null) {\n fn(h);\n }\n });\n } finally {\n if (!--internals.iterationDepth) {\n syncHandlerEntries(this, internals);\n trimHandlers(this.handlers);\n internals.handlersLength = countHandlers(this.handlers);\n }\n }\n }"} | |
| {"repo":"axios","file":"lib/core/assertParamsAcyclic.js","line":6,"symbol":"assertParamsAcyclic","kind":"function","lang":"javascript","code":"function assertParamsAcyclic(params) {\n const pending = [{ value: params }];\n const active = new WeakSet();\n const visited = new WeakSet();\n\n while (pending.length) {\n const { value, done } = pending.pop();\n if (!utils.isPlainObject(value) && !utils.isArray(value)) continue;\n if (done) {\n active.delete(value);\n continue;\n }\n if (active.has(value)) {\n throw new AxiosError(\n 'Circular reference detected in params',\n AxiosError.ERR_BAD_OPTION_VALUE\n );\n }\n if (visited.has(value)) continue;\n visited.add(value);\n active.add(value);\n pending.push({ value, done: true });\n\n const keys = Object.keys(value);\n if (Object.getOwnPropertySymbols && Object.getOwnPropertyDescriptor) {\n Object.getOwnPropertySymbols(value).forEach((key) => {\n const descriptor = Object.getOwnPropertyDescriptor(value, key);\n if (descriptor && descriptor.enumerable) keys.push(key);\n });\n }\n // Shallow array elements retain fields filtered during plain-object merges.\n // Inspect reserved data properties without evaluating their accessors.\n keys.forEach((key) => {\n if (key === '__proto__' || key === 'constru"} | |
| {"repo":"axios","file":"lib/core/buildFullPath.js","line":18,"symbol":"redactFragment","kind":"function","lang":"javascript","doc":"are commonly logged, while the opt-in `config.redact` model only cleans config keys — it cannot reach the message. Redact only the genuinely sensitive substrings — userinfo (credentials), query parameter values and fragment contents — with the same REDACTED marker the config redaction uses, while keeping the scheme, host, path and parameter names so the offending request stays accurately identifiable.","code":"function redactFragment(fragment) {\n if (!fragment) {\n return fragment;\n }\n\n return fragment.replace(/(^|&)([^=&]*=)?[^&]+/g, (match, separator, parameterName = '') => {\n return `${separator}${parameterName}${REDACTED}`;\n });\n}"} | |
| {"repo":"axios","file":"lib/core/buildFullPath.js","line":28,"symbol":"redactSensitiveURLParts","kind":"function","lang":"javascript","code":"function redactSensitiveURLParts(url) {\n const redactedURL = url.replace(/^(https?:\\/{0,2})[^/?#]*@/i, `$1${REDACTED}@`);\n const fragmentIndex = redactedURL.indexOf('#');\n const urlWithoutFragment =\n fragmentIndex === -1 ? redactedURL : redactedURL.slice(0, fragmentIndex);\n const redactedURLWithoutFragment = urlWithoutFragment.replace(\n /([?&][^=&#]*=)[^&#]*/g,\n `$1${REDACTED}`\n );\n\n if (fragmentIndex === -1) {\n return redactedURLWithoutFragment;\n }\n\n return `${redactedURLWithoutFragment}#${redactFragment(redactedURL.slice(fragmentIndex + 1))}`;\n}"} | |
| {"repo":"axios","file":"lib/core/buildFullPath.js","line":45,"symbol":"assertValidHttpProtocolURL","kind":"function","lang":"javascript","code":"function assertValidHttpProtocolURL(url, config) {\n if (typeof url === 'string') {\n const normalizedURL = normalizeURLForProtocolCheck(url);\n if (malformedHttpProtocol.test(normalizedURL)) {\n throw new AxiosError(\n `Invalid URL ${JSON.stringify(redactSensitiveURLParts(normalizedURL))}: missing \"//\" after protocol`,\n AxiosError.ERR_INVALID_URL,\n config\n );\n }\n }\n}"} | |
| {"repo":"axios","file":"lib/core/buildFullPath.js","line":68,"symbol":"buildFullPath","kind":"function","lang":"javascript","doc":"@param {string} baseURL The base URL @param {string} requestedURL Absolute or relative URL to combine @returns {string} The combined full path","code":"function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls, config) {\n assertValidHttpProtocolURL(requestedURL, config);\n let isRelativeUrl = !isAbsoluteURL(requestedURL);\n if (baseURL && (isRelativeUrl || allowAbsoluteUrls === false)) {\n assertValidHttpProtocolURL(baseURL, config);\n return combineURLs(baseURL, requestedURL);\n }\n return requestedURL;\n}"} | |
| {"repo":"axios","file":"lib/core/createMultipartBody.js","line":6,"symbol":"createMultipartBody","kind":"function","lang":"javascript","code":"function createMultipartBody(form, Blob, limit, limitError, boundary) {\n // Report missing Blob support before trying to select a random source.\n if (!utils.isFunction(Blob)) {\n throw new AxiosError('Blob is not supported', AxiosError.ERR_NOT_SUPPORT);\n }\n\n if (boundary === undefined) {\n if (utils.isFunction(platform.generateString)) {\n boundary = 'axios-' + platform.generateString(36, '0123456789abcdef');\n } else {\n const crypto = utils.global.crypto;\n if (!crypto || !utils.isFunction(crypto.getRandomValues)) {\n throw new AxiosError('Random byte generation is not supported', AxiosError.ERR_NOT_SUPPORT);\n }\n const random = new Uint8Array(18);\n crypto.getRandomValues(random);\n boundary =\n 'axios-' + Array.from(random, (value) => ('0' + value.toString(16)).slice(-2)).join('');\n }\n }\n\n try {\n return formDataToBlob(form, Blob, limit, limitError, boundary);\n } catch (error) {\n if (error instanceof FormDataError) {\n const code =\n error.reason === 'boundary' ? AxiosError.ERR_BAD_OPTION_VALUE : AxiosError.ERR_BAD_REQUEST;\n throw new AxiosError(error.message, code);\n }\n throw error;\n }\n}"} | |
| {"repo":"axios","file":"lib/core/dispatchRequest.js","line":18,"symbol":"throwIfCancellationRequested","kind":"function","lang":"javascript","doc":"Throws a `CanceledError` if cancellation has been requested. @param {Object} config The config that is to be used for the request @returns {void}","code":"function throwIfCancellationRequested(config) {\n if (config.cancelToken) {\n config.cancelToken.throwIfRequested();\n }\n\n if (config.signal && config.signal.aborted) {\n throw new CanceledError(null, config);\n }\n}"} | |
| {"repo":"axios","file":"lib/core/dispatchRequest.js","line":35,"symbol":"dispatchRequest","kind":"function","lang":"javascript","doc":"Dispatch a request to the server using the configured adapter. @param {object} config The config that is to be used for the request @returns {Promise} The Promise to be fulfilled","code":"function dispatchRequest(_config) {\n // Interceptors may replace the merged config with an ordinary object. Flatten\n // it at the dispatch boundary so shared prototype members cannot become\n // request behavior, while preserving intentional template/class members.\n const config = utils.toSafeFlatObject(_config);\n\n throwIfCancellationRequested(config);\n\n config.headers = AxiosHeaders.from(utils.getSafeProp(config, 'headers'));\n\n // Transform request data\n config.data = transformData.call(config, config.transformRequest);\n\n if (['post', 'put', 'patch'].indexOf(config.method) !== -1) {\n config.headers.setContentType('application/x-www-form-urlencoded', false);\n }\n\n const adapter = adapters.getAdapter(config.adapter || defaults.adapter, config);\n\n return adapter(config).then(\n function onAdapterResolution(response) {\n throwIfCancellationRequested(config);\n\n // Expose the current response on config so that transformResponse can\n // attach it to any AxiosError it throws (e.g. on JSON parse failure).\n // We clean it up afterwards to avoid polluting the config object.\n config.response = response;\n try {\n response.data = transformData.c"} | |
| {"repo":"axios","file":"lib/core/mergeConfig.js","line":23,"symbol":"mergeParams","kind":"function","lang":"javascript","doc":"Copy params without recursive merges so the serializer remains responsible for its depth policy. Only visit defaults that contribute to the result.","code":"function mergeParams(a, b) {\n const pending = [];\n const copies = new WeakMap();\n const empty = {};\n\n function copy(target, source) {\n if (!utils.isPlainObject(source)) {\n return utils.isArray(source) ? source.slice() : source;\n }\n\n const base = utils.isPlainObject(target) ? target : empty;\n let bases = copies.get(source);\n if (!bases) {\n bases = new WeakMap();\n copies.set(source, bases);\n }\n if (bases.has(base)) return bases.get(base);\n\n const result = {};\n bases.set(base, result);\n pending.push({ base, source, result });\n return result;\n }\n\n const result = utils.isUndefined(b) ? copy(undefined, a) : copy(a, b);\n while (pending.length) {\n const { base, source, result: target } = pending.pop();\n const baseKeys = new Set(ownEnumerableKeys(base));\n const sourceKeys = new Set(ownEnumerableKeys(source));\n const keys = new Set([...baseKeys, ...sourceKeys]);\n\n keys.forEach((key) => {\n if (key === '__proto__' || key === 'constructor' || key === 'prototype') return;\n const hasSource = sourceKeys.has(key);\n const value = hasSource ? source[key] : undefined;\n const previous =\n (!hasSource || util"} | |
| {"repo":"axios","file":"lib/core/mergeConfig.js","line":28,"symbol":"copy","kind":"function","lang":"javascript","code":"function copy(target, source) {\n if (!utils.isPlainObject(source)) {\n return utils.isArray(source) ? source.slice() : source;\n }\n\n const base = utils.isPlainObject(target) ? target : empty;\n let bases = copies.get(source);\n if (!bases) {\n bases = new WeakMap();\n copies.set(source, bases);\n }\n if (bases.has(base)) return bases.get(base);\n\n const result = {};\n bases.set(base, result);\n pending.push({ base, source, result });\n return result;\n }"} | |
| {"repo":"axios","file":"lib/core/mergeConfig.js","line":77,"symbol":"mergeConfig","kind":"function","lang":"javascript","doc":"@param {Object} config1 @param {Object} config2 @returns {Object} New object resulting from merging config2 to config1","code":"function mergeConfig(config1, config2) {\n // eslint-disable-next-line no-param-reassign\n config1 = config1 || {};\n config2 = config2 || {};\n\n // Use a null-prototype object so that downstream reads such as `config.auth`\n // or `config.baseURL` cannot inherit polluted values from Object.prototype.\n // `hasOwnProperty` is restored as a non-enumerable own slot to preserve\n // ergonomics for user code that relies on it.\n const config = Object.create(null);\n Object.defineProperty(config, 'hasOwnProperty', {\n // Null-proto descriptor so a polluted Object.prototype.get cannot turn\n // this data descriptor into an accessor descriptor on the way in.\n __proto__: null,\n value: Object.prototype.hasOwnProperty,\n enumerable: false,\n writable: true,\n configurable: true,\n });\n\n function getMergedValue(target, source, prop, caseless) {\n if (utils.isPlainObject(target) && utils.isPlainObject(source)) {\n return utils.merge.call({ caseless }, target, source);\n } else if (utils.isPlainObject(source)) {\n return utils.merge({}, source);\n } else if (utils.isArray(source)) {\n return source.slice();\n }\n return source;\n }\n\n function mergeDeepPro"} | |
| {"repo":"axios","file":"lib/core/mergeConfig.js","line":97,"symbol":"getMergedValue","kind":"function","lang":"javascript","code":"function getMergedValue(target, source, prop, caseless) {\n if (utils.isPlainObject(target) && utils.isPlainObject(source)) {\n return utils.merge.call({ caseless }, target, source);\n } else if (utils.isPlainObject(source)) {\n return utils.merge({}, source);\n } else if (utils.isArray(source)) {\n return source.slice();\n }\n return source;\n }"} | |
| {"repo":"axios","file":"lib/core/mergeConfig.js","line":108,"symbol":"mergeDeepProperties","kind":"function","lang":"javascript","code":"function mergeDeepProperties(a, b, prop, caseless) {\n if (!utils.isUndefined(b)) {\n return getMergedValue(a, b, prop, caseless);\n } else if (!utils.isUndefined(a)) {\n return getMergedValue(undefined, a, prop, caseless);\n }\n }"} | |
| {"repo":"axios","file":"lib/core/mergeConfig.js","line":117,"symbol":"valueFromConfig2","kind":"function","lang":"javascript","doc":"eslint-disable-next-line consistent-return","code":"function valueFromConfig2(a, b) {\n if (!utils.isUndefined(b)) {\n return getMergedValue(undefined, b);\n }\n }"} | |
| {"repo":"axios","file":"lib/core/mergeConfig.js","line":124,"symbol":"defaultToConfig2","kind":"function","lang":"javascript","doc":"eslint-disable-next-line consistent-return","code":"function defaultToConfig2(a, b) {\n if (!utils.isUndefined(b)) {\n return getMergedValue(undefined, b);\n } else if (!utils.isUndefined(a)) {\n return getMergedValue(undefined, a);\n }\n }"} | |
| {"repo":"axios","file":"lib/core/mergeConfig.js","line":132,"symbol":"getMergedTransitionalOption","kind":"function","lang":"javascript","code":"function getMergedTransitionalOption(prop) {\n const transitional2 = utils.hasOwnProp(config2, 'transitional')\n ? config2.transitional\n : undefined;\n\n if (!utils.isUndefined(transitional2)) {\n if (utils.isPlainObject(transitional2)) {\n if (utils.hasOwnProp(transitional2, prop)) {\n return transitional2[prop];\n }\n } else {\n return undefined;\n }\n }\n\n const transitional1 = utils.hasOwnProp(config1, 'transitional')\n ? config1.transitional\n : undefined;\n\n if (utils.isPlainObject(transitional1) && utils.hasOwnProp(transitional1, prop)) {\n return transitional1[prop];\n }\n\n return undefined;\n }"} | |
| {"repo":"axios","file":"lib/core/mergeConfig.js","line":159,"symbol":"mergeDirectKeys","kind":"function","lang":"javascript","doc":"eslint-disable-next-line consistent-return","code":"function mergeDirectKeys(a, b, prop) {\n if (utils.hasOwnProp(config2, prop)) {\n return getMergedValue(a, b);\n } else if (utils.hasOwnProp(config1, prop)) {\n return getMergedValue(undefined, a);\n }\n }"} | |
| {"repo":"axios","file":"lib/core/setFormDataHeaders.js","line":16,"symbol":"setFormDataHeaders","kind":"function","lang":"javascript","doc":"@param {AxiosHeaders} headers - the request headers to mutate @param {Object | null | undefined} formHeaders - headers produced by the FormData implementation @param {String} [policy] - the resolved `formDataHeaderPolicy` config value @returns {void}","code":"function setFormDataHeaders(headers, formHeaders, policy) {\n if (policy !== 'content-only') {\n headers.set(formHeaders);\n return;\n }\n\n Object.entries(formHeaders || {}).forEach(([key, val]) => {\n if (FORM_DATA_CONTENT_HEADERS.includes(key.toLowerCase())) {\n headers.set(key, val);\n }\n });\n}"} | |
| {"repo":"axios","file":"lib/core/settle.js","line":14,"symbol":"settle","kind":"function","lang":"javascript","doc":"@param {Function} resolve A function that resolves the promise. @param {Function} reject A function that rejects the promise. @param {object} response The response. @returns {object} The response.","code":"function settle(resolve, reject, response) {\n const validateStatus = response.config.validateStatus;\n if (!response.status || !validateStatus || validateStatus(response.status)) {\n resolve(response);\n } else {\n reject(new AxiosError(\n 'Request failed with status code ' + response.status,\n response.status >= 400 && response.status < 500 ? AxiosError.ERR_BAD_REQUEST : AxiosError.ERR_BAD_RESPONSE,\n response.config,\n response.request,\n response\n ));\n }\n}"} | |
| {"repo":"axios","file":"lib/core/transformData.js","line":15,"symbol":"transformData","kind":"function","lang":"javascript","doc":"@param {Array|Function} fns A single function or Array of functions @param {?Object} response The response object @returns {*} The resulting transformed data","code":"function transformData(fns, response) {\n const config = this || defaults;\n const context = response || config;\n const headers = AxiosHeaders.from(context.headers);\n let data = context.data;\n\n utils.forEach(fns, function transform(fn) {\n data = fn.call(config, data, headers.normalize(), response ? response.status : undefined);\n });\n\n headers.normalize();\n\n return data;\n}"} | |
| {"repo":"axios","file":"lib/defaults/index.js","line":24,"symbol":"stringifySafely","kind":"function","lang":"javascript","doc":"@param {any} rawValue - The value to be stringified. @param {Function} parser - A function that parses a string into a JavaScript object. @param {Function} encoder - A function that takes a value and returns a string. @returns {string} A stringified version of the rawValue.","code":"function stringifySafely(rawValue, parser, encoder) {\n if (utils.isString(rawValue)) {\n try {\n (parser || JSON.parse)(rawValue);\n return utils.trim(rawValue);\n } catch (e) {\n if (e.name !== 'SyntaxError') {\n throw e;\n }\n }\n }\n\n return (encoder || JSON.stringify)(rawValue);\n}"} | |
| {"repo":"axios","file":"lib/helpers/AxiosTransformStream.js","line":8,"symbol":"AxiosTransformStream","kind":"class","lang":"javascript","code":"class AxiosTransformStream extends stream.Transform {\n constructor(options) {\n options = utils.toFlatObject(\n options,\n {\n maxRate: 0,\n chunkSize: 64 * 1024,\n minChunkSize: 100,\n timeWindow: 500,\n ticksRate: 2,\n samplesCount: 15,\n },\n null,\n (prop, source) => {\n return !utils.isUndefined(source[prop]);\n }\n );\n\n super({\n readableHighWaterMark: options.chunkSize,\n });\n\n const internals = (this[kInternals] = {\n timeWindow: options.timeWindow,\n chunkSize: options.chunkSize,\n maxRate: options.maxRate,\n minChunkSize: options.minChunkSize,\n bytesSeen: 0,\n isCaptured: false,\n notifiedBytesLoaded: 0,\n ts: Date.now(),\n bytes: 0,\n onReadCallback: null,\n });\n\n this.on('newListener', (event) => {\n if (event === 'progress') {\n if (!internals.isCaptured) {\n internals.isCaptured = true;\n }\n }\n });\n }\n\n _read(size) {\n const internals = this[kInternals];\n\n if (internals.onReadCallback) {\n internals.onReadCallback();\n }\n\n return super._read(size);\n }\n\n _transform(chunk, encoding, callback) {"} | |
| {"repo":"axios","file":"lib/helpers/AxiosTransformStream.js","line":9,"symbol":"constructor","kind":"method","lang":"javascript","code":"constructor(options) {\n options = utils.toFlatObject(\n options,\n {\n maxRate: 0,\n chunkSize: 64 * 1024,\n minChunkSize: 100,\n timeWindow: 500,\n ticksRate: 2,\n samplesCount: 15,\n },\n null,\n (prop, source) => {\n return !utils.isUndefined(source[prop]);\n }\n );\n\n super({\n readableHighWaterMark: options.chunkSize,\n });\n\n const internals = (this[kInternals] = {\n timeWindow: options.timeWindow,\n chunkSize: options.chunkSize,\n maxRate: options.maxRate,\n minChunkSize: options.minChunkSize,\n bytesSeen: 0,\n isCaptured: false,\n notifiedBytesLoaded: 0,\n ts: Date.now(),\n bytes: 0,\n onReadCallback: null,\n });\n\n this.on('newListener', (event) => {\n if (event === 'progress') {\n if (!internals.isCaptured) {\n internals.isCaptured = true;\n }\n }\n });\n }"} | |
| {"repo":"axios","file":"lib/helpers/AxiosTransformStream.js","line":52,"symbol":"_read","kind":"method","lang":"javascript","code":"_read(size) {\n const internals = this[kInternals];\n\n if (internals.onReadCallback) {\n internals.onReadCallback();\n }\n\n return super._read(size);\n }"} | |
| {"repo":"axios","file":"lib/helpers/AxiosTransformStream.js","line":62,"symbol":"_transform","kind":"method","lang":"javascript","code":"_transform(chunk, encoding, callback) {\n const internals = this[kInternals];\n const maxRate = internals.maxRate;\n\n const readableHighWaterMark = this.readableHighWaterMark;\n\n const timeWindow = internals.timeWindow;\n\n const divider = 1000 / timeWindow;\n const bytesThreshold = maxRate / divider;\n let minChunkSize =\n internals.minChunkSize !== false\n ? Math.max(internals.minChunkSize, bytesThreshold * 0.01)\n : 0;\n\n if (maxRate) {\n minChunkSize = Math.min(bytesThreshold, minChunkSize);\n }\n\n const pushChunk = (_chunk, _callback) => {\n const bytes = Buffer.byteLength(_chunk);\n internals.bytesSeen += bytes;\n internals.bytes += bytes;\n\n internals.isCaptured && this.emit('progress', internals.bytesSeen);\n\n if (this.push(_chunk)) {\n process.nextTick(_callback);\n } else {\n internals.onReadCallback = () => {\n internals.onReadCallback = null;\n process.nextTick(_callback);\n };\n }\n };\n\n const transformChunk = (_chunk, _callback) => {\n if (this.destroyed) {\n return _callback();\n }\n const chunkSize = Buffer.byteLength(_chunk);\n let chunkRe"} | |
| {"repo":"axios","file":"lib/helpers/AxiosURLSearchParams.js","line":13,"symbol":"encode","kind":"function","lang":"javascript","doc":"their percent-encoded equivalents @param {string} str - The string to encode. @returns {string} The encoded string.","code":"function encode(str) {\n const charMap = {\n '!': '%21',\n \"'\": '%27',\n '(': '%28',\n ')': '%29',\n '~': '%7E',\n '%20': '+',\n };\n return encodeURIComponent(str).replace(/[!'()~]|%20/g, function replacer(match) {\n return charMap[match];\n });\n}"} | |
| {"repo":"axios","file":"lib/helpers/AxiosURLSearchParams.js","line":35,"symbol":"AxiosURLSearchParams","kind":"function","lang":"javascript","doc":"@param {Object<string, any>} params - The parameters to be converted to a FormData object. @param {Object<string, any>} options - The options object passed to the Axios constructor. @returns {void}","code":"function AxiosURLSearchParams(params, options) {\n this._pairs = [];\n\n params && toFormData(params, this, options);\n}"} | |
| {"repo":"axios","file":"lib/helpers/Http2Sessions.js","line":11,"symbol":"Http2Sessions","kind":"class","lang":"javascript","code":"class Http2Sessions {\n constructor() {\n this.sessions = Object.create(null);\n }\n\n getSession(authority, options) {\n options = Object.assign(\n Object.create(null),\n {\n sessionTimeout: 1000,\n },\n options\n );\n\n let authoritySessions = this.sessions[authority];\n\n if (authoritySessions) {\n let len = authoritySessions.length;\n\n for (let i = 0; i < len; i++) {\n const [sessionHandle, sessionOptions] = authoritySessions[i];\n if (\n !sessionHandle.destroyed &&\n !sessionHandle.closed &&\n util.isDeepStrictEqual(sessionOptions, options)\n ) {\n return sessionHandle;\n }\n }\n }\n\n const session = http2.connect(authority, options);\n\n let removed;\n let timer;\n\n const removeSession = () => {\n if (removed) {\n return;\n }\n\n removed = true;\n\n if (timer) {\n clearTimeout(timer);\n timer = null;\n }\n\n let entries = authoritySessions,\n len = entries.length,\n i = len;\n\n while (i--) {\n if (entries[i][0] === session) {\n if (len === 1) {\n delete this.sessions[authority];\n } els"} | |
| {"repo":"axios","file":"lib/helpers/Http2Sessions.js","line":12,"symbol":"constructor","kind":"method","lang":"javascript","code":"constructor() {\n this.sessions = Object.create(null);\n }"} | |
| {"repo":"axios","file":"lib/helpers/Http2Sessions.js","line":16,"symbol":"getSession","kind":"method","lang":"javascript","code":"getSession(authority, options) {\n options = Object.assign(\n Object.create(null),\n {\n sessionTimeout: 1000,\n },\n options\n );\n\n let authoritySessions = this.sessions[authority];\n\n if (authoritySessions) {\n let len = authoritySessions.length;\n\n for (let i = 0; i < len; i++) {\n const [sessionHandle, sessionOptions] = authoritySessions[i];\n if (\n !sessionHandle.destroyed &&\n !sessionHandle.closed &&\n util.isDeepStrictEqual(sessionOptions, options)\n ) {\n return sessionHandle;\n }\n }\n }\n\n const session = http2.connect(authority, options);\n\n let removed;\n let timer;\n\n const removeSession = () => {\n if (removed) {\n return;\n }\n\n removed = true;\n\n if (timer) {\n clearTimeout(timer);\n timer = null;\n }\n\n let entries = authoritySessions,\n len = entries.length,\n i = len;\n\n while (i--) {\n if (entries[i][0] === session) {\n if (len === 1) {\n delete this.sessions[authority];\n } else {\n entries.splice(i, 1);\n }\n if (!session.closed) {\n "} | |
| {"repo":"axios","file":"lib/helpers/ZlibHeaderTransformStream.js","line":5,"symbol":"ZlibHeaderTransformStream","kind":"class","lang":"javascript","code":"class ZlibHeaderTransformStream extends stream.Transform {\n __transform(chunk, encoding, callback) {\n this.push(chunk);\n callback();\n }\n\n _transform(chunk, encoding, callback) {\n if (chunk.length !== 0) {\n this._transform = this.__transform;\n\n // Add Default Compression headers if no zlib headers are present\n if (chunk[0] !== 120) {\n // Hex: 78\n const header = Buffer.alloc(2);\n header[0] = 120; // Hex: 78\n header[1] = 156; // Hex: 9C\n this.push(header, encoding);\n }\n }\n\n this.__transform(chunk, encoding, callback);\n }\n}"} | |
| {"repo":"axios","file":"lib/helpers/ZlibHeaderTransformStream.js","line":6,"symbol":"__transform","kind":"method","lang":"javascript","code":"__transform(chunk, encoding, callback) {\n this.push(chunk);\n callback();\n }"} | |
| {"repo":"axios","file":"lib/helpers/ZlibHeaderTransformStream.js","line":11,"symbol":"_transform","kind":"method","lang":"javascript","code":"_transform(chunk, encoding, callback) {\n if (chunk.length !== 0) {\n this._transform = this.__transform;\n\n // Add Default Compression headers if no zlib headers are present\n if (chunk[0] !== 120) {\n // Hex: 78\n const header = Buffer.alloc(2);\n header[0] = 120; // Hex: 78\n header[1] = 156; // Hex: 9C\n this.push(header, encoding);\n }\n }\n\n this.__transform(chunk, encoding, callback);\n }"} | |
| {"repo":"axios","file":"lib/helpers/bind.js","line":10,"symbol":"bind","kind":"function","lang":"javascript","doc":"Create a bound version of a function with a specified `this` context @param {Function} fn - The function to bind @param {*} thisArg - The value to be passed as the `this` parameter @returns {Function} A new function that will call the original function with the specified `this` context","code":"function bind(fn, thisArg) {\n return function wrap() {\n return fn.apply(thisArg, arguments);\n };\n}"} | |
| {"repo":"axios","file":"lib/helpers/buildURL.js","line":14,"symbol":"encode","kind":"function","lang":"javascript","doc":"their plain counterparts (`:`, `$`, `,`, `+`). @param {string} val The value to be encoded. @returns {string} The encoded value.","code":"function encode(val) {\n return encodeURIComponent(val)\n .replace(/%3A/gi, ':')\n .replace(/%24/g, '$')\n .replace(/%2C/gi, ',')\n .replace(/%20/g, '+');\n}"} | |
| {"repo":"axios","file":"lib/helpers/buildURL.js","line":31,"symbol":"buildURL","kind":"function","lang":"javascript","doc":"@param {string} url The base of the url (e.g., http://www.google.com) @param {object} [params] The params to be appended @param {?(object|Function)} options @returns {string} The formatted url","code":"function buildURL(url, params, options) {\n if (!params) {\n return url;\n }\n url = url || '';\n\n const _options = utils.isFunction(options)\n ? {\n serialize: options,\n }\n : options;\n\n // Read serializer options pollution-safely: own properties and methods on a\n // class/template prototype are honored, but values injected onto a polluted\n // Object.prototype are ignored.\n const _encode = utils.getSafeProp(_options, 'encode') || encode;\n const serializeFn = utils.getSafeProp(_options, 'serialize');\n\n let serializedParams;\n\n if (serializeFn) {\n serializedParams = serializeFn(params, _options);\n } else {\n serializedParams = utils.isURLSearchParams(params)\n ? params.toString()\n : new AxiosURLSearchParams(params, _options).toString(_encode);\n }\n\n if (serializedParams) {\n const hashmarkIndex = url.indexOf('#');\n\n if (hashmarkIndex !== -1) {\n url = url.slice(0, hashmarkIndex);\n }\n url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;\n }\n\n return url;\n}"} | |
| {"repo":"axios","file":"lib/helpers/combineURLs.js","line":11,"symbol":"combineURLs","kind":"function","lang":"javascript","doc":"@param {string} baseURL The base URL @param {string} relativeURL The relative URL @returns {string} The combined URL","code":"function combineURLs(baseURL, relativeURL) {\n if (!relativeURL) {\n return baseURL;\n }\n\n let end = baseURL.length;\n\n while (end > 0 && baseURL.charCodeAt(end - 1) === 47) {\n end--;\n }\n\n return baseURL.slice(0, end) + '/' + relativeURL.replace(/^\\/+/, '');\n}"} | |
| {"repo":"axios","file":"lib/helpers/cookies.js","line":7,"symbol":"write","kind":"method","lang":"javascript","code":"write(name, value, expires, path, domain, secure, sameSite) {\n if (typeof document === 'undefined') return;\n\n const cookie = [`${name}=${encodeURIComponent(value)}`];\n\n if (utils.isNumber(expires)) {\n cookie.push(`expires=${new Date(expires).toUTCString()}`);\n }\n if (utils.isString(path)) {\n cookie.push(`path=${path}`);\n }\n if (utils.isString(domain)) {\n cookie.push(`domain=${domain}`);\n }\n if (secure === true) {\n cookie.push('secure');\n }\n if (utils.isString(sameSite)) {\n cookie.push(`SameSite=${sameSite}`);\n }\n\n document.cookie = cookie.join('; ');\n }"} | |
| {"repo":"axios","file":"lib/helpers/cookies.js","line":31,"symbol":"read","kind":"method","lang":"javascript","code":"read(name) {\n if (typeof document === 'undefined') return null;\n // Match name=value by splitting on the semicolon separator instead of building a\n // RegExp from `name` — interpolating an unescaped string into a RegExp would let\n // metacharacters (e.g. `.+?` in an attacker-influenced cookie name) cause ReDoS or\n // match the wrong cookie. Browsers may serialize cookie pairs as either \";\" or\n // \"; \", so ignore optional whitespace before each cookie name.\n const cookies = document.cookie.split(';');\n for (let i = 0; i < cookies.length; i++) {\n const cookie = cookies[i].replace(/^\\s+/, '');\n const eq = cookie.indexOf('=');\n if (eq !== -1 && cookie.slice(0, eq) === name) {\n try {\n return decodeURIComponent(cookie.slice(eq + 1));\n } catch (e) {\n return cookie.slice(eq + 1);\n }\n }\n }\n return null;\n }"} | |
| {"repo":"axios","file":"lib/helpers/cookies.js","line":53,"symbol":"remove","kind":"method","lang":"javascript","code":"remove(name) {\n this.write(name, '', Date.now() - 86400000, '/');\n }"} | |
| {"repo":"axios","file":"lib/helpers/cookies.js","line":59,"symbol":"write","kind":"method","lang":"javascript","code":"write() {}"} | |
| {"repo":"axios","file":"lib/helpers/cookies.js","line":60,"symbol":"read","kind":"method","lang":"javascript","code":"read() {\n return null;\n }"} | |
| {"repo":"axios","file":"lib/helpers/cookies.js","line":63,"symbol":"remove","kind":"method","lang":"javascript","code":"remove() {}"} | |
| {"repo":"axios","file":"lib/helpers/deprecatedMethod.js","line":15,"symbol":"deprecatedMethod","kind":"function","lang":"javascript","doc":"@param {string} method The name of the deprecated method @param {string} [instead] The alternate method to use if applicable @param {string} [docs] The documentation URL to get further details @returns {void}","code":"function deprecatedMethod(method, instead, docs) {\n try {\n console.warn(\n 'DEPRECATED method `' +\n method +\n '`.' +\n (instead ? ' Use `' + instead + '` instead.' : '') +\n ' This method will be removed in a future release.'\n );\n\n if (docs) {\n console.warn('For more information about usage see ' + docs);\n }\n } catch (e) {\n /* Ignore */\n }\n}"} | |
| {"repo":"axios","file":"lib/helpers/estimateDataURLDecodedBytes.js","line":148,"symbol":"estimateDataURLDecodedBytes","kind":"function","lang":"javascript","doc":"Estimate the percent-decoded payload size used by Fetch data: URLs. @param {string} url @returns {number}","code":"function estimateDataURLDecodedBytes(url) {\n // Fetch removes URL fragments before processing a data: URL.\n const fragmentIndex = typeof url === 'string' ? url.indexOf('#') : -1;\n\n return estimateDataURLBytes(\n fragmentIndex === -1 ? url : url.slice(0, fragmentIndex),\n estimatePercentDecodedBase64Bytes,\n /; *base64[\\t\\n\\f\\r ]*$/i\n );\n}"} | |
| {"repo":"axios","file":"lib/helpers/estimateDataURLDecodedBytes.js","line":165,"symbol":"estimateDataURLBufferAllocation","kind":"function","lang":"javascript","doc":"Estimate the Buffer backing allocation used by Node's raw base64 decoder. @param {string} url @returns {number}","code":"function estimateDataURLBufferAllocation(url) {\n // fromDataURI recognizes only the lowercase protocol and encoding suffix.\n if (typeof url !== 'string' || url.slice(0, 5) !== 'data:') return 0;\n return estimateDataURLBytes(url, estimateBase64BufferAllocation, /;base64$/);\n}"} | |
| {"repo":"axios","file":"lib/helpers/formDataToBlob.js","line":39,"symbol":"FormDataError","kind":"class","lang":"javascript","doc":"Describe serialization failures independently of any request library.","code":"class FormDataError extends TypeError {\n constructor(message, reason) {\n super(message);\n this.name = 'FormDataError';\n this.reason = reason;\n }\n}"} | |
| {"repo":"axios","file":"lib/helpers/formDataToBlob.js","line":40,"symbol":"constructor","kind":"method","lang":"javascript","code":"constructor(message, reason) {\n super(message);\n this.name = 'FormDataError';\n this.reason = reason;\n }"} | |
| {"repo":"axios","file":"lib/helpers/formDataToBlob.js","line":48,"symbol":"formDataToBlob","kind":"function","lang":"javascript","doc":"The caller supplies the boundary, Blob implementation, and limit error.","code":"function formDataToBlob(form, Blob, limit, limitError, boundary) {\n if (!utils.isFunction(Blob)) {\n throw new FormDataError('Blob is not supported', 'blob');\n }\n\n if (\n !utils.isString(boundary) ||\n !/^[A-Za-z0-9'()+_,./:=? -]{1,70}$/.test(boundary) ||\n / $/.test(boundary)\n ) {\n throw new FormDataError('Invalid multipart boundary', 'boundary');\n }\n const footer = '--' + boundary + '--' + CRLF;\n let length = footer.length;\n const parts = [];\n const checkLength = (extra) => {\n if (length + extra > limit) throw limitError();\n };\n checkLength(0);\n\n for (const [name, value] of form) {\n const isString = utils.isString(value);\n const valueLength = isString ? stringBytes(value, true) : value.size;\n if (!Number.isFinite(valueLength) || valueLength < 0) {\n throw new FormDataError('Unsupported FormData part size', 'part');\n }\n // Reject large values and names before building normalized header strings.\n checkLength(\n valueLength +\n stringBytes(name, true) +\n (!isString && value.name ? stringBytes(value.name, false) : 0) +\n (!isString && value.type ? stringBytes(value.type, false) : 0)\n );\n\n let header =\n "} | |
| {"repo":"axios","file":"lib/helpers/formDataToJSON.js","line":9,"symbol":"throwIfDepthExceeded","kind":"function","lang":"javascript","code":"function throwIfDepthExceeded(index) {\n if (index > MAX_DEPTH) {\n throw new AxiosError(\n 'FormData field is too deeply nested (' + index + ' levels). Max depth: ' + MAX_DEPTH,\n AxiosError.ERR_FORM_DATA_DEPTH_EXCEEDED\n );\n }\n}"} | |
| {"repo":"axios","file":"lib/helpers/formDataToJSON.js","line":25,"symbol":"parsePropPath","kind":"function","lang":"javascript","doc":"It takes a string like `foo[x][y][z]` and returns an array like `['foo', 'x', 'y', 'z'] @param {string} name - The name of the property to get. @returns An array of strings.","code":"function parsePropPath(name) {\n // foo[x][y][z] -> ['foo', 'x', 'y', 'z']\n // foo.x.y.z -> ['foo', 'x', 'y', 'z']\n // A path is split on `.` and on `[...]` groups. A segment — whether written\n // in dot notation or captured inside brackets — may contain any character\n // except `.`, `[` and `]`, so a key like `user-name` or `user name` is kept\n // literal instead of being split (#5402). `.`, `[` and `]` keep their existing\n // meaning, e.g. `foo[bar.baz]` -> ['foo', 'bar', 'baz'] and `[]` is an array push.\n // Excluding `[` from the bracket group also makes the match fail fast at the\n // next `[`, so a malformed name cannot rescan to the end of the string from\n // every unmatched `[` — parsing stays linear in the length of the name.\n const path = [];\n const pattern = /[^.[\\]]+|\\[([^.[\\]]*)]/g;\n let match;\n\n while ((match = pattern.exec(name)) !== null) {\n throwIfDepthExceeded(path.length);\n path.push(match[0] === '[]' ? '' : match[1] || match[0]);\n }\n\n return path;\n}"} | |
| {"repo":"axios","file":"lib/helpers/formDataToJSON.js","line":55,"symbol":"arrayToObject","kind":"function","lang":"javascript","doc":"Convert an array to an object. @param {Array<any>} arr - The array to convert to an object. @returns An object with the same keys and values as the array.","code":"function arrayToObject(arr) {\n const obj = {};\n const keys = Object.keys(arr);\n let i;\n const len = keys.length;\n let key;\n for (i = 0; i < len; i++) {\n key = keys[i];\n obj[key] = arr[key];\n }\n return obj;\n}"} | |
| {"repo":"axios","file":"lib/helpers/formDataToJSON.js","line":68,"symbol":"normalizeArray","kind":"function","lang":"javascript","code":"function normalizeArray(value) {\n if (!utils.isArray(value)) return value;\n\n const keys = Object.keys(value);\n return keys.length !== value.length || keys.some((key, index) => key !== String(index))\n ? arrayToObject(value)\n : value;\n}"} | |
| {"repo":"axios","file":"lib/helpers/formDataToJSON.js","line":77,"symbol":"normalizeArrays","kind":"function","lang":"javascript","code":"function normalizeArrays(obj) {\n const pending = [obj];\n while (pending.length) {\n const target = pending.pop();\n Object.keys(target).forEach((key) => {\n const value = (target[key] = normalizeArray(target[key]));\n if (utils.isArray(value) || utils.isPlainObject(value)) {\n pending.push(value);\n }\n });\n }\n return obj;\n}"} | |
| {"repo":"axios","file":"lib/helpers/formDataToJSON.js","line":98,"symbol":"formDataToJSON","kind":"function","lang":"javascript","doc":"It takes a FormData object and returns a JavaScript object @param {string} formData The FormData object to convert to JSON. @returns {Object<string, any> | null} The converted object.","code":"function formDataToJSON(formData) {\n function buildPath(path, value, target, index) {\n throwIfDepthExceeded(index);\n\n let name = path[index++];\n\n if (name === '__proto__') return true;\n\n const isNumericKey = Number.isFinite(+name);\n const isLast = index >= path.length;\n name = !name && utils.isArray(target) ? target.length : name;\n\n if (isLast) {\n if (utils.hasOwnProp(target, name)) {\n target[name] = normalizeArray(target[name]);\n target[name] = utils.isArray(target[name])\n ? target[name].concat(value)\n : [target[name], value];\n } else {\n target[name] = value;\n }\n\n return !isNumericKey;\n }\n\n if (!utils.hasOwnProp(target, name) || !utils.isObject(target[name])) {\n target[name] = [];\n }\n\n const result = buildPath(path, value, target[name], index);\n\n if (result && utils.isArray(target[name])) {\n target[name] = arrayToObject(target[name]);\n }\n\n return !isNumericKey;\n }\n\n if (utils.isFormData(formData) && utils.isFunction(formData.entries)) {\n const obj = {};\n\n utils.forEachEntry(formData, (name, value) => {\n buildPath(parsePropPath(name), value, obj, 0);\n });\n"} | |
| {"repo":"axios","file":"lib/helpers/formDataToJSON.js","line":99,"symbol":"buildPath","kind":"function","lang":"javascript","code":"function buildPath(path, value, target, index) {\n throwIfDepthExceeded(index);\n\n let name = path[index++];\n\n if (name === '__proto__') return true;\n\n const isNumericKey = Number.isFinite(+name);\n const isLast = index >= path.length;\n name = !name && utils.isArray(target) ? target.length : name;\n\n if (isLast) {\n if (utils.hasOwnProp(target, name)) {\n target[name] = normalizeArray(target[name]);\n target[name] = utils.isArray(target[name])\n ? target[name].concat(value)\n : [target[name], value];\n } else {\n target[name] = value;\n }\n\n return !isNumericKey;\n }\n\n if (!utils.hasOwnProp(target, name) || !utils.isObject(target[name])) {\n target[name] = [];\n }\n\n const result = buildPath(path, value, target[name], index);\n\n if (result && utils.isArray(target[name])) {\n target[name] = arrayToObject(target[name]);\n }\n\n return !isNumericKey;\n }"} | |
| {"repo":"axios","file":"lib/helpers/formDataToStream.js","line":15,"symbol":"FormDataPart","kind":"class","lang":"javascript","code":"class FormDataPart {\n constructor(name, value) {\n const { escapeName } = this.constructor;\n const isStringValue = utils.isString(value);\n\n let headers = `Content-Disposition: form-data; name=\"${escapeName(name)}\"${\n !isStringValue && value.name ? `; filename=\"${escapeName(value.name)}\"` : ''\n }${CRLF}`;\n\n if (isStringValue) {\n value = textEncoder.encode(String(value).replace(/\\r?\\n|\\r\\n?/g, CRLF));\n } else {\n const safeType = String(value.type || 'application/octet-stream').replace(/[\\r\\n]/g, '');\n headers += `Content-Type: ${safeType}${CRLF}`;\n }\n\n this.headers = textEncoder.encode(headers + CRLF);\n\n this.contentLength = isStringValue ? value.byteLength : value.size;\n\n this.size = this.headers.byteLength + this.contentLength + CRLF_BYTES_COUNT;\n\n this.name = name;\n this.value = value;\n }\n\n async *encode() {\n yield this.headers;\n\n const { value } = this;\n\n if (utils.isTypedArray(value)) {\n yield value;\n } else {\n yield* readBlob(value);\n }\n\n yield CRLF_BYTES;\n }\n\n static escapeName(name) {\n return String(name).replace(\n /[\\r\\n\"]/g,\n (match) =>\n ({\n '\\r': '%0D',\n "} | |
| {"repo":"axios","file":"lib/helpers/formDataToStream.js","line":16,"symbol":"constructor","kind":"method","lang":"javascript","code":"constructor(name, value) {\n const { escapeName } = this.constructor;\n const isStringValue = utils.isString(value);\n\n let headers = `Content-Disposition: form-data; name=\"${escapeName(name)}\"${\n !isStringValue && value.name ? `; filename=\"${escapeName(value.name)}\"` : ''\n }${CRLF}`;\n\n if (isStringValue) {\n value = textEncoder.encode(String(value).replace(/\\r?\\n|\\r\\n?/g, CRLF));\n } else {\n const safeType = String(value.type || 'application/octet-stream').replace(/[\\r\\n]/g, '');\n headers += `Content-Type: ${safeType}${CRLF}`;\n }\n\n this.headers = textEncoder.encode(headers + CRLF);\n\n this.contentLength = isStringValue ? value.byteLength : value.size;\n\n this.size = this.headers.byteLength + this.contentLength + CRLF_BYTES_COUNT;\n\n this.name = name;\n this.value = value;\n }"} | |
| {"repo":"axios","file":"lib/helpers/formDataToStream.js","line":41,"symbol":"encode","kind":"method","lang":"javascript","code":"async *encode() {\n yield this.headers;\n\n const { value } = this;\n\n if (utils.isTypedArray(value)) {\n yield value;\n } else {\n yield* readBlob(value);\n }\n\n yield CRLF_BYTES;\n }"} | |
| {"repo":"axios","file":"lib/helpers/formDataToStream.js","line":55,"symbol":"escapeName","kind":"method","lang":"javascript","code":"static escapeName(name) {\n return String(name).replace(\n /[\\r\\n\"]/g,\n (match) =>\n ({\n '\\r': '%0D',\n '\\n': '%0A',\n '\"': '%22',\n })[match]\n );\n }"} | |
| {"repo":"axios","file":"lib/helpers/fromDataURI.js","line":21,"symbol":"fromDataURI","kind":"function","lang":"javascript","doc":"@param {?Boolean} asBlob @param {?Object} options @param {?Function} options.Blob @returns {Buffer|Blob}","code":"function fromDataURI(uri, asBlob, options) {\n const _Blob = (options && options.Blob) || platform.classes.Blob;\n const protocol = parseProtocol(uri);\n\n if (asBlob === undefined && _Blob) {\n asBlob = true;\n }\n\n if (protocol === 'data') {\n uri = protocol.length ? uri.slice(protocol.length + 1) : uri;\n\n const match = DATA_URL_PATTERN.exec(uri);\n\n if (!match) {\n throw new AxiosError('Invalid URL', AxiosError.ERR_INVALID_URL);\n }\n\n const type = match[1];\n const params = match[2];\n const encoding = match[3] ? 'base64' : 'utf8';\n const body = match[4];\n\n // RFC 2397 section 3: default mediatype is text/plain;charset=US-ASCII\n // Bare `data:,` leaves mime undefined; Blob normalises that to \"\" per spec.\n let mime = '';\n if (type) {\n mime = params ? type + params : type;\n } else if (params) {\n mime = 'text/plain' + params;\n }\n\n const buffer =\n encoding === 'base64'\n ? Buffer.from(body, 'base64')\n : Buffer.from(decodeURIComponent(body), encoding);\n\n if (asBlob) {\n if (!_Blob) {\n throw new AxiosError('Blob is not supported', AxiosError.ERR_NOT_SUPPORT);\n }\n\n return new _Blob([buffer]"} | |
| {"repo":"axios","file":"lib/helpers/isAbsoluteURL.js","line":10,"symbol":"isAbsoluteURL","kind":"function","lang":"javascript","doc":"Determines whether the specified URL is absolute @param {string} url The URL to test @returns {boolean} True if the specified URL is absolute, otherwise false","code":"function isAbsoluteURL(url) {\n // A URL is considered absolute if it begins with \"<scheme>://\" or \"//\" (protocol-relative URL).\n // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed\n // by any combination of letters, digits, plus, period, or hyphen.\n if (typeof url !== 'string') {\n return false;\n }\n\n return /^([a-z][a-z\\d+\\-.]*:)?\\/\\//i.test(url);\n}"} | |
| {"repo":"axios","file":"lib/helpers/isAxiosError.js","line":12,"symbol":"isAxiosError","kind":"function","lang":"javascript","doc":"Determines whether the payload is an error thrown by Axios @param {*} payload The value to test @returns {boolean} True if the payload is an error thrown by Axios, otherwise false","code":"function isAxiosError(payload) {\n return utils.isObject(payload) && payload.isAxiosError === true;\n}"} | |
| {"repo":"axios","file":"lib/helpers/normalizeURLForProtocolCheck.js","line":12,"symbol":"normalizeURLForProtocolCheck","kind":"function","lang":"javascript","doc":"Match WHATWG URL preprocessing before checking a URL's protocol. @param {string} url @returns {string}","code":"function normalizeURLForProtocolCheck(url) {\n if (typeof url !== 'string') {\n return url;\n }\n\n let start = 0;\n\n while (start < url.length && url.charCodeAt(start) <= 0x20) {\n start++;\n }\n\n return url.slice(start).replace(urlParserControlCharacters, '');\n}"} | |
| {"repo":"axios","file":"lib/helpers/parseProtocol.js","line":3,"symbol":"parseProtocol","kind":"function","lang":"javascript","code":"function parseProtocol(url) {\n const match = /^([-+\\w]{1,25}):(?:\\/\\/)?/.exec(url);\n return (match && match[1]) || '';\n}"} | |
| {"repo":"axios","file":"lib/helpers/resolveConfig.js","line":25,"symbol":"resolveConfig","kind":"function","lang":"javascript","code":"function resolveConfig(config) {\n const newConfig = mergeConfig({}, config);\n\n // Read only own properties to prevent prototype pollution gadgets\n // (e.g. Object.prototype.baseURL = 'https://evil.com').\n const own = (key) => (utils.hasOwnProp(newConfig, key) ? newConfig[key] : undefined);\n\n const data = own('data');\n let withXSRFToken = own('withXSRFToken');\n const xsrfHeaderName = own('xsrfHeaderName');\n const xsrfCookieName = own('xsrfCookieName');\n let headers = own('headers');\n const auth = own('auth');\n const baseURL = own('baseURL');\n const allowAbsoluteUrls = own('allowAbsoluteUrls');\n const url = own('url');\n\n newConfig.headers = headers = AxiosHeaders.from(headers);\n\n newConfig.url = buildURL(\n buildFullPath(baseURL, url, allowAbsoluteUrls, newConfig),\n own('params'),\n own('paramsSerializer')\n );\n\n // HTTP basic authentication\n if (auth) {\n const username = utils.getSafeProp(auth, 'username') || '';\n const password = utils.getSafeProp(auth, 'password') || '';\n\n try {\n headers.set(\n 'Authorization',\n 'Basic ' + btoa(username + ':' + (password ? encodeUTF8(password) : ''))\n );\n } catch (e) {\n throw AxiosErr"} | |
| {"repo":"axios","file":"lib/helpers/sanitizeHeaderValue.js","line":5,"symbol":"trimSPorHTAB","kind":"function","lang":"javascript","code":"function trimSPorHTAB(str) {\n let start = 0;\n let end = str.length;\n\n while (start < end) {\n const code = str.charCodeAt(start);\n\n if (code !== 0x09 && code !== 0x20) {\n break;\n }\n\n start += 1;\n }\n\n while (end > start) {\n const code = str.charCodeAt(end - 1);\n\n if (code !== 0x09 && code !== 0x20) {\n break;\n }\n\n end -= 1;\n }\n\n return start === 0 && end === str.length ? str : str.slice(start, end);\n}"} | |
| {"repo":"axios","file":"lib/helpers/sanitizeHeaderValue.js","line":38,"symbol":"sanitizeValue","kind":"function","lang":"javascript","code":"function sanitizeValue(value, invalidChars) {\n if (utils.isArray(value)) {\n return value.map((item) => sanitizeValue(item, invalidChars));\n }\n\n return trimSPorHTAB(String(value).replace(invalidChars, ''));\n}"} | |
| {"repo":"axios","file":"lib/helpers/sanitizeHeaderValue.js","line":52,"symbol":"toByteStringHeaderObject","kind":"function","lang":"javascript","code":"function toByteStringHeaderObject(headers) {\n const byteStringHeaders = Object.create(null);\n\n utils.forEach(headers.toJSON(), (value, header) => {\n byteStringHeaders[header] = sanitizeByteStringHeaderValue(value);\n });\n\n return byteStringHeaders;\n}"} | |
| {"repo":"axios","file":"lib/helpers/shouldBypassProxy.js","line":453,"symbol":"shouldBypassProxy","kind":"function","lang":"javascript","code":"function shouldBypassProxy(location) {\n let parsed;\n\n try {\n parsed = new URL(location);\n } catch (_err) {\n return false;\n }\n\n const noProxy = (process.env.no_proxy || process.env.NO_PROXY || '').toLowerCase();\n\n if (!noProxy) {\n return false;\n }\n\n if (noProxy === '*') {\n return true;\n }\n\n const port =\n Number.parseInt(parsed.port, 10) || DEFAULT_PORTS[parsed.protocol.split(':', 1)[0]] || 0;\n\n const hostname = normalizeNoProxyHost(parsed.hostname.toLowerCase());\n const hostnameBytes = ipToBytes(hostname);\n\n return noProxy.split(/[\\s,]+/).some((entry) => {\n if (!entry) {\n return false;\n }\n\n if (entry === '*') {\n return true;\n }\n\n const cidr = parseCidrEntry(entry);\n\n if (cidr !== undefined) {\n return (\n cidr !== null &&\n !!hostnameBytes &&\n hostnameBytes.length === cidr.bytes.length &&\n isInSubnet(hostnameBytes, cidr.bytes, cidr.prefix)\n );\n }\n\n let [entryHost, entryPort] = parseNoProxyEntry(entry);\n\n entryHost = normalizeNoProxyHost(entryHost);\n\n if (!entryHost) {\n return false;\n }\n\n if (entryPort && entryPort !== port) {\n return false;\n }\n\n if (entryHost."} | |
| {"repo":"axios","file":"lib/helpers/speedometer.js","line":9,"symbol":"speedometer","kind":"function","lang":"javascript","doc":"Calculate data maxRate @param {Number} [samplesCount= 10] @param {Number} [min= 1000] @returns {Function}","code":"function speedometer(samplesCount, min) {\n samplesCount = samplesCount || 10;\n const bytes = new Array(samplesCount);\n const timestamps = new Array(samplesCount);\n let head = 0;\n let tail = 0;\n let firstSampleTS;\n\n min = min !== undefined ? min : 1000;\n\n return function push(chunkLength) {\n const now = Date.now();\n\n const startedAt = timestamps[tail];\n\n if (!firstSampleTS) {\n firstSampleTS = now;\n }\n\n bytes[head] = chunkLength;\n timestamps[head] = now;\n\n let i = tail;\n let bytesCount = 0;\n\n while (i !== head) {\n bytesCount += bytes[i++];\n i = i % samplesCount;\n }\n\n head = (head + 1) % samplesCount;\n\n if (head === tail) {\n tail = (tail + 1) % samplesCount;\n }\n\n if (now - firstSampleTS < min) {\n return;\n }\n\n const passed = startedAt && now - startedAt;\n\n return passed ? Math.round((bytesCount * 1000) / passed) : undefined;\n };\n}"} | |
| {"repo":"axios","file":"lib/helpers/spread.js","line":24,"symbol":"spread","kind":"function","lang":"javascript","doc":"``` @param {Function} callback @returns {Function}","code":"function spread(callback) {\n return function wrap(arr) {\n return callback.apply(null, arr);\n };\n}"} | |
| {"repo":"axios","file":"lib/helpers/throttle.js","line":7,"symbol":"throttle","kind":"function","lang":"javascript","doc":"Throttle decorator @param {Function} fn @param {Number} freq @return {Array<Function>}","code":"function throttle(fn, freq) {\n let timestamp = 0;\n let threshold = 1000 / freq;\n let lastArgs;\n let timer;\n\n const invoke = (args, now = Date.now()) => {\n timestamp = now;\n lastArgs = null;\n if (timer) {\n clearTimeout(timer);\n timer = null;\n }\n fn(...args);\n };\n\n const throttled = (...args) => {\n const now = Date.now();\n const passed = now - timestamp;\n if (passed >= threshold) {\n invoke(args, now);\n } else {\n lastArgs = args;\n if (!timer) {\n timer = setTimeout(() => {\n timer = null;\n invoke(lastArgs);\n }, threshold - passed);\n }\n }\n };\n\n const flush = () => lastArgs && invoke(lastArgs);\n const flushWith = (...args) => invoke(args);\n\n return [throttled, flush, flushWith];\n}"} | |
| {"repo":"axios","file":"lib/helpers/toFormData.js","line":20,"symbol":"isVisitable","kind":"function","lang":"javascript","doc":"Determines if the given thing is a array or js object. @param {string} thing - The object or array to be visited. @returns {boolean}","code":"function isVisitable(thing) {\n return utils.isPlainObject(thing) || utils.isArray(thing);\n}"} | |
| {"repo":"axios","file":"lib/helpers/toFormData.js","line":31,"symbol":"removeBrackets","kind":"function","lang":"javascript","doc":"It removes the brackets from the end of a string @param {string} key - The key of the parameter. @returns {string} the key without the brackets.","code":"function removeBrackets(key) {\n return utils.endsWith(key, '[]') ? key.slice(0, -2) : key;\n}"} | |
| {"repo":"axios","file":"lib/helpers/toFormData.js","line":44,"symbol":"renderKey","kind":"function","lang":"javascript","doc":"@param {string} path - The path to the current key. @param {string} key - The key of the current object being iterated over. @param {string} dots - If true, the key will be rendered with dots instead of brackets. @returns {string} The path to the current key.","code":"function renderKey(path, key, dots) {\n if (!path) return key;\n return path\n .concat(key)\n .map(function each(token, i) {\n // eslint-disable-next-line no-param-reassign\n token = removeBrackets(token);\n return !dots && i ? '[' + token + ']' : token;\n })\n .join(dots ? '.' : '');\n}"} | |
| {"repo":"axios","file":"lib/helpers/toFormData.js","line":63,"symbol":"isFlatArray","kind":"function","lang":"javascript","doc":"If the array is an array and none of its elements are visitable, then it's a flat array. @param {Array<any>} arr - The array to check @returns {boolean}","code":"function isFlatArray(arr) {\n return utils.isArray(arr) && !arr.some(isVisitable);\n}"} | |
| {"repo":"axios","file":"lib/helpers/toFormData.js","line":94,"symbol":"toFormData","kind":"function","lang":"javascript","doc":"@param {Object<any, any>} obj - The object to convert to form data. @param {string} formData - The FormData object to append to. @param {Object<string, any>} options @returns","code":"function toFormData(obj, formData, options) {\n if (!utils.isObject(obj)) {\n throw new TypeError('target must be an object');\n }\n\n // eslint-disable-next-line no-param-reassign\n formData = formData || new (PlatformFormData || FormData)();\n\n const option = (name, fallback) => {\n const value = utils.getSafeProp(options, name);\n return utils.isUndefined(value) ? fallback : value;\n };\n\n const metaTokens = option('metaTokens', true);\n // eslint-disable-next-line no-use-before-define\n const visitor = option('visitor') || defaultVisitor;\n const dots = option('dots', false);\n const indexes = option('indexes', false);\n const _Blob = option('Blob') || (typeof Blob !== 'undefined' && Blob);\n const maxDepth = option('maxDepth', DEFAULT_FORM_DATA_MAX_DEPTH);\n const useBlob = _Blob && utils.isSpecCompliantForm(formData);\n const stack = [];\n\n if (!utils.isFunction(visitor)) {\n throw new TypeError('visitor must be a function');\n }\n\n function convertValue(value) {\n if (value === null) return '';\n\n if (utils.isDate(value)) {\n return value.toISOString();\n }\n\n if (utils.isBoolean(value)) {\n return value.toString();\n }\n\n if (!useBlob && utils.isB"} | |
| {"repo":"axios","file":"lib/helpers/toFormData.js","line":121,"symbol":"convertValue","kind":"function","lang":"javascript","code":"function convertValue(value) {\n if (value === null) return '';\n\n if (utils.isDate(value)) {\n return value.toISOString();\n }\n\n if (utils.isBoolean(value)) {\n return value.toString();\n }\n\n if (!useBlob && utils.isBlob(value)) {\n throw new AxiosError('Blob is not supported. Use a Buffer instead.');\n }\n\n if (utils.isArrayBuffer(value) || utils.isTypedArray(value)) {\n if (useBlob && typeof _Blob === 'function') {\n return new _Blob([value]);\n }\n if (PlatformBuffer && PlatformBuffer.isBufferAvailable()) {\n return PlatformBuffer.from(value);\n }\n throw new AxiosError(\n 'Blob is not supported. Use a Buffer instead.',\n AxiosError.ERR_NOT_SUPPORT\n );\n }\n\n return value;\n }"} | |
| {"repo":"axios","file":"lib/helpers/toFormData.js","line":152,"symbol":"throwIfMaxDepthExceeded","kind":"function","lang":"javascript","code":"function throwIfMaxDepthExceeded(depth) {\n if (depth > maxDepth) {\n throw new AxiosError(\n 'Object is too deeply nested (' + depth + ' levels). Max depth: ' + maxDepth,\n AxiosError.ERR_FORM_DATA_DEPTH_EXCEEDED\n );\n }\n }"} | |
| {"repo":"axios","file":"lib/helpers/toFormData.js","line":161,"symbol":"stringifyWithDepthLimit","kind":"function","lang":"javascript","code":"function stringifyWithDepthLimit(value, depth) {\n if (maxDepth === Infinity) {\n return JSON.stringify(value);\n }\n\n const ancestors = [];\n\n return JSON.stringify(value, function limitDepth(_key, currentValue) {\n if (!utils.isObject(currentValue)) {\n return currentValue;\n }\n\n while (ancestors.length && ancestors[ancestors.length - 1] !== this) {\n ancestors.pop();\n }\n\n ancestors.push(currentValue);\n throwIfMaxDepthExceeded(depth + ancestors.length - 1);\n\n return currentValue;\n });\n }"} | |
| {"repo":"axios","file":"lib/helpers/toFormData.js","line":194,"symbol":"defaultVisitor","kind":"function","lang":"javascript","doc":"@param {String|Number} key @param {Array<String|Number>} path @this {FormData} @returns {boolean} return true to visit the each prop of the value recursively","code":"function defaultVisitor(value, key, path) {\n let arr = value;\n\n if (utils.isReactNative(formData) && utils.isReactNativeBlob(value)) {\n formData.append(renderKey(path, key, dots), convertValue(value));\n return false;\n }\n\n if (value && !path && typeof value === 'object') {\n if (utils.endsWith(key, '{}')) {\n // eslint-disable-next-line no-param-reassign\n key = metaTokens ? key : key.slice(0, -2);\n // eslint-disable-next-line no-param-reassign\n value = stringifyWithDepthLimit(value, 1);\n } else if (\n (utils.isArray(value) && isFlatArray(value)) ||\n ((utils.isFileList(value) || utils.endsWith(key, '[]')) && (arr = utils.toArray(value)))\n ) {\n // eslint-disable-next-line no-param-reassign\n key = removeBrackets(key);\n\n arr.forEach(function each(el, index) {\n !(utils.isUndefined(el) || el === null) &&\n formData.append(\n // eslint-disable-next-line no-nested-ternary\n indexes === true\n ? renderKey([key], index, dots)\n : indexes === null\n ? key\n : key + '[]',\n convertValue"} | |
| {"repo":"axios","file":"lib/helpers/toFormData.js","line":246,"symbol":"build","kind":"function","lang":"javascript","code":"function build(value, path, depth = 0) {\n if (utils.isUndefined(value)) return;\n\n throwIfMaxDepthExceeded(depth);\n\n if (stack.indexOf(value) !== -1) {\n throw new Error('Circular reference detected in ' + path.join('.'));\n }\n\n stack.push(value);\n\n utils.forEach(value, function each(el, key) {\n const result =\n !(utils.isUndefined(el) || el === null) &&\n visitor.call(formData, el, utils.isString(key) ? key.trim() : key, path, exposedHelpers);\n\n if (result === true) {\n build(el, path ? path.concat(key) : [key], depth + 1);\n }\n });\n\n stack.pop();\n }"} | |
| {"repo":"axios","file":"lib/helpers/toURLEncodedForm.js","line":7,"symbol":"toURLEncodedForm","kind":"function","lang":"javascript","code":"function toURLEncodedForm(data, options) {\n return toFormData(data, new platform.classes.URLSearchParams(), {\n visitor: function (value, key, path, helpers) {\n if (platform.isNode && utils.isBuffer(value)) {\n this.append(key, value.toString('base64'));\n return false;\n }\n\n return helpers.defaultVisitor.apply(this, arguments);\n },\n ...options,\n });\n}"} | |
| {"repo":"axios","file":"lib/helpers/trackStream.js","line":59,"symbol":"pull","kind":"method","lang":"javascript","code":"async pull(controller) {\n try {\n const { done, value } = await iterator.next();\n\n if (done) {\n _onFinish();\n controller.close();\n return;\n }\n\n let len = value.byteLength;\n if (onProgress) {\n let loadedBytes = (bytes += len);\n onProgress(loadedBytes);\n }\n controller.enqueue(new Uint8Array(value));\n } catch (err) {\n _onFinish(err);\n throw err;\n }\n }"} | |
| {"repo":"axios","file":"lib/helpers/trackStream.js","line":80,"symbol":"cancel","kind":"method","lang":"javascript","code":"cancel(reason) {\n _onFinish(reason);\n return iterator.return();\n }"} | |
| {"repo":"axios","file":"lib/helpers/validator.js","line":27,"symbol":"formatMessage","kind":"function","lang":"javascript","code":"function formatMessage(opt, desc) {\n return (\n '[Axios v' +\n VERSION +\n \"] Transitional option '\" +\n opt +\n \"'\" +\n desc +\n (message ? '. ' + message : '')\n );\n }"} | |
| {"repo":"axios","file":"lib/helpers/validator.js","line":81,"symbol":"assertOptions","kind":"function","lang":"javascript","code":"function assertOptions(options, schema, allowUnknown) {\n if (typeof options !== 'object' || options === null) {\n throw new AxiosError('options must be an object', AxiosError.ERR_BAD_OPTION_VALUE);\n }\n const keys = Object.keys(options);\n let i = keys.length;\n while (i-- > 0) {\n const opt = keys[i];\n // Use hasOwnProperty so a polluted Object.prototype.<opt> cannot supply\n // a non-function validator and cause a TypeError.\n const validator = Object.prototype.hasOwnProperty.call(schema, opt) ? schema[opt] : undefined;\n if (validator) {\n const value = options[opt];\n const result = value === undefined || validator(value, opt, options);\n if (result !== true) {\n throw new AxiosError(\n 'option ' + opt + ' must be ' + result,\n AxiosError.ERR_BAD_OPTION_VALUE\n );\n }\n continue;\n }\n if (allowUnknown !== true) {\n throw new AxiosError('Unknown option ' + opt, AxiosError.ERR_BAD_OPTION);\n }\n }\n}"} | |
| {"repo":"axios","file":"lib/platform/node/classes/Buffer.js","line":4,"symbol":"isBufferAvailable","kind":"method","lang":"javascript","code":"isBufferAvailable() {\n return typeof Buffer !== 'undefined';\n }"} | |
| {"repo":"axios","file":"lib/platform/node/classes/Buffer.js","line":8,"symbol":"from","kind":"method","lang":"javascript","code":"from(value) {\n return Buffer.from(value);\n }"} | |
| {"repo":"axios","file":"lib/utils.js","line":221,"symbol":"isBuffer","kind":"function","lang":"javascript","doc":"Determine if a value is a Buffer @param {*} val The value to test @returns {boolean} True if value is a Buffer, otherwise false","code":"function isBuffer(val) {\n return (\n val !== null &&\n !isUndefined(val) &&\n val.constructor !== null &&\n !isUndefined(val.constructor) &&\n isFunction(val.constructor.isBuffer) &&\n val.constructor.isBuffer(val)\n );\n}"} | |
| {"repo":"axios","file":"lib/utils.js","line":248,"symbol":"isArrayBufferView","kind":"function","lang":"javascript","doc":"Determine if a value is a view on an ArrayBuffer @param {*} val The value to test @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false","code":"function isArrayBufferView(val) {\n let result;\n if (typeof ArrayBuffer !== 'undefined' && ArrayBuffer.isView) {\n result = ArrayBuffer.isView(val);\n } else {\n result = val && val.buffer && isArrayBuffer(val.buffer);\n }\n return result;\n}"} | |
| {"repo":"axios","file":"lib/utils.js","line":423,"symbol":"getGlobal","kind":"function","lang":"javascript","doc":"Determine if a value is a FormData @param {*} thing The value to test @returns {boolean} True if value is an FormData, otherwise false","code":"function getGlobal() {\n if (typeof globalThis !== 'undefined') return globalThis;\n if (typeof self !== 'undefined') return self;\n if (typeof window !== 'undefined') return window;\n if (typeof global !== 'undefined') return global;\n return {};\n}"} | |
| {"repo":"axios","file":"lib/utils.js","line":491,"symbol":"forEach","kind":"function","lang":"javascript","doc":"@param {Function} fn The callback to invoke for each item @param {Object} [options] @param {Boolean} [options.allOwnKeys = false] @returns {any}","code":"function forEach(obj, fn, { allOwnKeys = false } = {}) {\n // Don't bother if no value provided\n if (obj === null || typeof obj === 'undefined') {\n return;\n }\n\n let i;\n let l;\n\n // Force an array if not already something iterable\n if (typeof obj !== 'object') {\n /*eslint no-param-reassign:0*/\n obj = [obj];\n }\n\n if (isArray(obj)) {\n // Iterate over array values\n for (i = 0, l = obj.length; i < l; i++) {\n fn.call(null, obj[i], i, obj);\n }\n } else {\n // Buffer check\n if (isBuffer(obj)) {\n return;\n }\n\n // Iterate over object keys\n const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj);\n const len = keys.length;\n let key;\n\n for (i = 0; i < len; i++) {\n key = keys[i];\n fn.call(null, obj[key], key, obj);\n }\n }\n}"} | |
| {"repo":"axios","file":"lib/utils.js","line":537,"symbol":"findKey","kind":"function","lang":"javascript","doc":"Returns null if the object is a Buffer or if no match is found. @param {Object} obj - The object to search. @param {string} key - The key to find (case-insensitive). @returns {?string} The actual key name if found, otherwise null.","code":"function findKey(obj, key) {\n if (isBuffer(obj)) {\n return null;\n }\n\n key = key.toLowerCase();\n const keys = Object.keys(obj);\n let i = keys.length;\n let _key;\n while (i-- > 0) {\n _key = keys[i];\n if (key === _key.toLowerCase()) {\n return _key;\n }\n }\n return null;\n}"} | |
| {"repo":"axios","file":"lib/utils.js","line":581,"symbol":"merge","kind":"function","lang":"javascript","doc":"``` @param {Object} obj1 Object to merge @returns {Object} Result of all merge properties","code":"function merge(...objs) {\n const { caseless, skipUndefined } = (isContextDefined(this) && this) || {};\n const result = {};\n const assignValue = (val, key) => {\n // Skip dangerous property names to prevent prototype pollution\n if (key === '__proto__' || key === 'constructor' || key === 'prototype') {\n return;\n }\n\n // findKey lowercases the key, so caseless lookup only applies to strings —\n // symbol keys are identity-matched.\n const targetKey = (caseless && typeof key === 'string' && findKey(result, key)) || key;\n // Read via own-prop only — a bare `result[targetKey]` walks the prototype\n // chain, so a polluted Object.prototype value could surface here and get\n // copied into the merged result.\n const existing = hasOwnProperty(result, targetKey) ? result[targetKey] : undefined;\n if (isPlainObject(existing) && isPlainObject(val)) {\n result[targetKey] = merge(existing, val);\n } else if (isPlainObject(val)) {\n result[targetKey] = merge({}, val);\n } else if (isArray(val)) {\n result[targetKey] = val.slice();\n } else if (!skipUndefined || !isUndefined(val)) {\n result[targetKey] = val;\n }\n };\n\n for (let i = 0, l = "} | |
| {"repo":"axios","file":"lib/utils.js","line":969,"symbol":"isSpecCompliantForm","kind":"function","lang":"javascript","doc":"If the thing is a FormData object, return true, otherwise return false. @param {unknown} thing - The thing to check. @returns {boolean}","code":"function isSpecCompliantForm(thing) {\n return !!(\n thing &&\n isFunction(thing.append) &&\n thing[toStringTag] === 'FormData' &&\n thing[iterator]\n );\n}"} | |
| {"repo":"axios","file":"sandbox/client.js","line":9,"symbol":"handleSuccess","kind":"function","lang":"javascript","code":"function handleSuccess(data) {\n console.log(data);\n}"} | |
| {"repo":"axios","file":"sandbox/client.js","line":12,"symbol":"handleFailure","kind":"function","lang":"javascript","code":"function handleFailure(data) {\n console.log('error', data);\n}"} | |
| {"repo":"axios","file":"sandbox/server.js","line":14,"symbol":"pipeFileToResponse","kind":"function","lang":"javascript","doc":"Pipes a file to the HTTP response. @param {http.ServerResponse} res - The HTTP response object. @param {string} file - The relative path to the file to be served. @param {string} [type] - Optional MIME type for the response.","code":"function pipeFileToResponse(res, file, type) {\n if (type) {\n res.writeHead(200, {\n 'Content-Type': type,\n });\n }\n\n fs.createReadStream(path.join(path.resolve(), 'sandbox', file)).pipe(res);\n}"} | |
| {"repo":"axios","file":"sandbox/server.js","line":33,"symbol":"handleApiRequest","kind":"function","lang":"javascript","doc":"Collects request data, parses it as JSON, and returns a JSON response containing the request URL, method, headers, and parsed data. @param {http.IncomingMessage} req - The HTTP request object. @param {http.ServerResponse} res - The HTTP response object.","code":"function handleApiRequest(req, res) {\n let status;\n let result;\n let data = '';\n\n req.on('data', (chunk) => {\n data += chunk;\n });\n\n req.on('end', () => {\n try {\n status = 200;\n result = {\n url: req.url,\n data: data ? JSON.parse(data) : undefined,\n method: req.method,\n headers: req.headers,\n };\n } catch (e) {\n console.error('Error:', e.message);\n status = 400;\n result = {\n error: e.message,\n };\n }\n\n res.writeHead(status, {\n 'Content-Type': 'application/json',\n });\n res.end(JSON.stringify(result));\n });\n}"} | |
| {"repo":"axios","file":"sandbox/server.js","line":75,"symbol":"requestHandler","kind":"function","lang":"javascript","doc":"Serves static files like index.html and axios.js, or routes API requests to handleApiRequest. Responds with 404 for unrecognized paths. @param {http.IncomingMessage} req - The HTTP request object. @param {http.ServerResponse} res - The HTTP response object.","code":"function requestHandler(req, res) {\n req.setEncoding('utf8');\n\n const parsed = new URL(req.url, 'http://localhost');\n let pathname = parsed.pathname;\n\n console.log('[' + new Date() + ']', req.method, pathname);\n\n if (pathname === '/') {\n pathname = '/index.html';\n }\n\n switch (pathname) {\n case '/index.html':\n pipeFileToResponse(res, './client.html', 'text/html');\n break;\n\n case '/axios.js':\n pipeFileToResponse(res, '../dist/axios.js', 'text/javascript');\n break;\n\n case '/axios.js.map':\n pipeFileToResponse(res, '../dist/axios.js.map', 'text/javascript');\n break;\n\n case '/api':\n handleApiRequest(req, res);\n break;\n\n default:\n res.writeHead(404);\n res.end('<h1>404 Not Found</h1>');\n break;\n }\n}"} | |
| {"repo":"axios","file":"tests/browser/adapter.browser.test.js","line":5,"symbol":"MockXMLHttpRequest","kind":"class","lang":"javascript","code":"class MockXMLHttpRequest {\n constructor() {\n this.readyState = 0;\n this.status = 0;\n this.statusText = '';\n this.responseText = '';\n this.response = null;\n this.onreadystatechange = null;\n this.onloadend = null;\n this.upload = {\n addEventListener() {},\n };\n this.requestHeaders = {};\n }\n\n open(method, url, async = true) {\n this.method = method;\n this.url = url;\n this.async = async;\n }\n\n setRequestHeader(key, value) {\n this.requestHeaders[key] = value;\n }\n\n addEventListener() {}\n\n getAllResponseHeaders() {\n return '';\n }\n\n send(data) {\n this.params = data;\n requests.push(this);\n }\n\n respondWith({ status = 200, statusText = 'OK', responseText = '' } = {}) {\n this.status = status;\n this.statusText = statusText;\n this.responseText = responseText;\n this.response = responseText;\n this.readyState = 4;\n\n queueMicrotask(() => {\n if (this.onloadend) {\n this.onloadend();\n } else if (this.onreadystatechange) {\n this.onreadystatechange();\n }\n });\n }\n\n abort() {}\n}"} | |
| {"repo":"axios","file":"tests/browser/adapter.browser.test.js","line":6,"symbol":"constructor","kind":"method","lang":"javascript","code":"constructor() {\n this.readyState = 0;\n this.status = 0;\n this.statusText = '';\n this.responseText = '';\n this.response = null;\n this.onreadystatechange = null;\n this.onloadend = null;\n this.upload = {\n addEventListener() {},\n };\n this.requestHeaders = {};\n }"} | |
| {"repo":"axios","file":"tests/browser/adapter.browser.test.js","line":15,"symbol":"addEventListener","kind":"method","lang":"javascript","code":"addEventListener() {}"} | |
| {"repo":"axios","file":"tests/browser/adapter.browser.test.js","line":20,"symbol":"open","kind":"method","lang":"javascript","code":"open(method, url, async = true) {\n this.method = method;\n this.url = url;\n this.async = async;\n }"} | |
| {"repo":"axios","file":"tests/browser/adapter.browser.test.js","line":26,"symbol":"setRequestHeader","kind":"method","lang":"javascript","code":"setRequestHeader(key, value) {\n this.requestHeaders[key] = value;\n }"} | |
| {"repo":"axios","file":"tests/browser/adapter.browser.test.js","line":30,"symbol":"addEventListener","kind":"method","lang":"javascript","code":"addEventListener() {}"} | |
| {"repo":"axios","file":"tests/browser/adapter.browser.test.js","line":32,"symbol":"getAllResponseHeaders","kind":"method","lang":"javascript","code":"getAllResponseHeaders() {\n return '';\n }"} | |
| {"repo":"axios","file":"tests/browser/adapter.browser.test.js","line":36,"symbol":"send","kind":"method","lang":"javascript","code":"send(data) {\n this.params = data;\n requests.push(this);\n }"} | |
| {"repo":"axios","file":"tests/browser/adapter.browser.test.js","line":41,"symbol":"respondWith","kind":"method","lang":"javascript","code":"respondWith({ status = 200, statusText = 'OK', responseText = '' } = {}) {\n this.status = status;\n this.statusText = statusText;\n this.responseText = responseText;\n this.response = responseText;\n this.readyState = 4;\n\n queueMicrotask(() => {\n if (this.onloadend) {\n this.onloadend();\n } else if (this.onreadystatechange) {\n this.onreadystatechange();\n }\n });\n }"} | |
| {"repo":"axios","file":"tests/browser/adapter.browser.test.js","line":57,"symbol":"abort","kind":"method","lang":"javascript","code":"abort() {}"} | |
| {"repo":"axios","file":"tests/browser/adapter.browser.test.js","line":95,"symbol":"adapter","kind":"method","lang":"javascript","code":"adapter(config) {\n return new Promise((resolve) => {\n const request = new XMLHttpRequest();\n request.open('GET', '/bar');\n\n request.onreadystatechange = function onReadyStateChange() {\n resolve({\n config,\n request,\n });\n };\n\n request.send(null);\n });\n }"} | |
| {"repo":"axios","file":"tests/browser/adapter.browser.test.js","line":123,"symbol":"adapter","kind":"method","lang":"javascript","code":"adapter(config) {\n return new Promise((resolve) => {\n const request = new XMLHttpRequest();\n request.open('GET', '/bar');\n\n request.onreadystatechange = function onReadyStateChange() {\n resolve({\n config,\n request,\n });\n };\n\n expect(asyncFlag).toBe(false);\n request.send(null);\n });\n }"} | |
| {"repo":"axios","file":"tests/browser/adapter.browser.test.js","line":157,"symbol":"adapter","kind":"method","lang":"javascript","code":"adapter(config) {\n return new Promise((resolve) => {\n const request = new XMLHttpRequest();\n request.open('GET', '/bar');\n\n request.onreadystatechange = function onReadyStateChange() {\n resolve({\n config,\n request,\n });\n };\n\n expect(asyncFlag).toBe(true);\n request.send(null);\n });\n }"} | |
| {"repo":"axios","file":"tests/browser/basicAuth.browser.test.js","line":5,"symbol":"MockXMLHttpRequest","kind":"class","lang":"javascript","code":"class MockXMLHttpRequest {\n constructor() {\n this.requestHeaders = {};\n this.responseHeaders = '';\n this.readyState = 0;\n this.status = 0;\n this.statusText = '';\n this.responseText = '';\n this.response = null;\n this.onreadystatechange = null;\n this.onloadend = null;\n this.upload = {\n addEventListener() {},\n };\n }\n\n open(method, url, async = true) {\n this.method = method;\n this.url = url;\n this.async = async;\n }\n\n setRequestHeader(key, value) {\n this.requestHeaders[key] = value;\n }\n\n addEventListener() {}\n\n getAllResponseHeaders() {\n return this.responseHeaders;\n }\n\n send(data) {\n this.params = data;\n requests.push(this);\n }\n\n respondWith({ status = 200, statusText = 'OK', responseText = '', responseHeaders = '' } = {}) {\n this.status = status;\n this.statusText = statusText;\n this.responseText = responseText;\n this.response = responseText;\n this.responseHeaders = responseHeaders;\n this.readyState = 4;\n\n queueMicrotask(() => {\n if (this.onloadend) {\n this.onloadend();\n } else if (this.onreadystatechange) {\n this.onreadystatechange();\n }\n });\n }\n\n abort() {}\n}"} | |
| {"repo":"axios","file":"tests/browser/basicAuth.browser.test.js","line":6,"symbol":"constructor","kind":"method","lang":"javascript","code":"constructor() {\n this.requestHeaders = {};\n this.responseHeaders = '';\n this.readyState = 0;\n this.status = 0;\n this.statusText = '';\n this.responseText = '';\n this.response = null;\n this.onreadystatechange = null;\n this.onloadend = null;\n this.upload = {\n addEventListener() {},\n };\n }"} | |
| {"repo":"axios","file":"tests/browser/basicAuth.browser.test.js","line":17,"symbol":"addEventListener","kind":"method","lang":"javascript","code":"addEventListener() {}"} | |
| {"repo":"axios","file":"tests/browser/basicAuth.browser.test.js","line":21,"symbol":"open","kind":"method","lang":"javascript","code":"open(method, url, async = true) {\n this.method = method;\n this.url = url;\n this.async = async;\n }"} | |
| {"repo":"axios","file":"tests/browser/basicAuth.browser.test.js","line":27,"symbol":"setRequestHeader","kind":"method","lang":"javascript","code":"setRequestHeader(key, value) {\n this.requestHeaders[key] = value;\n }"} | |
| {"repo":"axios","file":"tests/browser/basicAuth.browser.test.js","line":31,"symbol":"addEventListener","kind":"method","lang":"javascript","code":"addEventListener() {}"} | |
| {"repo":"axios","file":"tests/browser/basicAuth.browser.test.js","line":33,"symbol":"getAllResponseHeaders","kind":"method","lang":"javascript","code":"getAllResponseHeaders() {\n return this.responseHeaders;\n }"} | |
| {"repo":"axios","file":"tests/browser/basicAuth.browser.test.js","line":37,"symbol":"send","kind":"method","lang":"javascript","code":"send(data) {\n this.params = data;\n requests.push(this);\n }"} | |
| {"repo":"axios","file":"tests/browser/basicAuth.browser.test.js","line":42,"symbol":"respondWith","kind":"method","lang":"javascript","code":"respondWith({ status = 200, statusText = 'OK', responseText = '', responseHeaders = '' } = {}) {\n this.status = status;\n this.statusText = statusText;\n this.responseText = responseText;\n this.response = responseText;\n this.responseHeaders = responseHeaders;\n this.readyState = 4;\n\n queueMicrotask(() => {\n if (this.onloadend) {\n this.onloadend();\n } else if (this.onreadystatechange) {\n this.onreadystatechange();\n }\n });\n }"} | |
| {"repo":"axios","file":"tests/browser/basicAuth.browser.test.js","line":59,"symbol":"abort","kind":"method","lang":"javascript","code":"abort() {}"} | |
| {"repo":"axios","file":"tests/browser/cancel.browser.test.js","line":5,"symbol":"MockXMLHttpRequest","kind":"class","lang":"javascript","code":"class MockXMLHttpRequest {\n constructor() {\n this.requestHeaders = {};\n this.responseHeaders = '';\n this.readyState = 0;\n this.status = 0;\n this.statusText = '';\n this.responseText = '';\n this.response = null;\n this.onreadystatechange = null;\n this.onloadend = null;\n this.onabort = null;\n this.upload = {\n addEventListener() {},\n };\n }\n\n open(method, url, async = true) {\n this.method = method;\n this.url = url;\n this.async = async;\n }\n\n setRequestHeader(key, value) {\n this.requestHeaders[key] = value;\n }\n\n addEventListener() {}\n\n getAllResponseHeaders() {\n return this.responseHeaders;\n }\n\n send(data) {\n this.params = data;\n requests.push(this);\n }\n\n respondWith({ status = 200, statusText = 'OK', responseText = '', responseHeaders = '' } = {}) {\n this.status = status;\n this.statusText = statusText;\n this.responseText = responseText;\n this.response = responseText;\n this.responseHeaders = responseHeaders;\n this.readyState = 4;\n\n queueMicrotask(() => {\n if (this.onloadend) {\n this.onloadend();\n } else if (this.onreadystatechange) {\n this.onreadystatechange();\n }\n "} | |
| {"repo":"axios","file":"tests/browser/cancel.browser.test.js","line":6,"symbol":"constructor","kind":"method","lang":"javascript","code":"constructor() {\n this.requestHeaders = {};\n this.responseHeaders = '';\n this.readyState = 0;\n this.status = 0;\n this.statusText = '';\n this.responseText = '';\n this.response = null;\n this.onreadystatechange = null;\n this.onloadend = null;\n this.onabort = null;\n this.upload = {\n addEventListener() {},\n };\n }"} | |
| {"repo":"axios","file":"tests/browser/cancel.browser.test.js","line":18,"symbol":"addEventListener","kind":"method","lang":"javascript","code":"addEventListener() {}"} | |
| {"repo":"axios","file":"tests/browser/cancel.browser.test.js","line":22,"symbol":"open","kind":"method","lang":"javascript","code":"open(method, url, async = true) {\n this.method = method;\n this.url = url;\n this.async = async;\n }"} | |
| {"repo":"axios","file":"tests/browser/cancel.browser.test.js","line":28,"symbol":"setRequestHeader","kind":"method","lang":"javascript","code":"setRequestHeader(key, value) {\n this.requestHeaders[key] = value;\n }"} | |
| {"repo":"axios","file":"tests/browser/cancel.browser.test.js","line":32,"symbol":"addEventListener","kind":"method","lang":"javascript","code":"addEventListener() {}"} | |
| {"repo":"axios","file":"tests/browser/cancel.browser.test.js","line":34,"symbol":"getAllResponseHeaders","kind":"method","lang":"javascript","code":"getAllResponseHeaders() {\n return this.responseHeaders;\n }"} | |
| {"repo":"axios","file":"tests/browser/cancel.browser.test.js","line":38,"symbol":"send","kind":"method","lang":"javascript","code":"send(data) {\n this.params = data;\n requests.push(this);\n }"} | |
| {"repo":"axios","file":"tests/browser/cancel.browser.test.js","line":43,"symbol":"respondWith","kind":"method","lang":"javascript","code":"respondWith({ status = 200, statusText = 'OK', responseText = '', responseHeaders = '' } = {}) {\n this.status = status;\n this.statusText = statusText;\n this.responseText = responseText;\n this.response = responseText;\n this.responseHeaders = responseHeaders;\n this.readyState = 4;\n\n queueMicrotask(() => {\n if (this.onloadend) {\n this.onloadend();\n } else if (this.onreadystatechange) {\n this.onreadystatechange();\n }\n });\n }"} | |
| {"repo":"axios","file":"tests/browser/cancel.browser.test.js","line":60,"symbol":"abort","kind":"method","lang":"javascript","code":"abort() {\n this.statusText = 'abort';\n if (this.onabort) {\n this.onabort();\n }\n }"} | |
| {"repo":"axios","file":"tests/browser/cookies.browser.test.js","line":49,"symbol":"get","kind":"method","lang":"javascript","code":"get() {\n return 'foo=abc;bar=def';\n }"} | |
| {"repo":"axios","file":"tests/browser/cookies.browser.test.js","line":83,"symbol":"get","kind":"method","lang":"javascript","code":"get() {\n return 'foo=bar%';\n }"} | |
| {"repo":"axios","file":"tests/browser/defaults.browser.test.js","line":7,"symbol":"MockXMLHttpRequest","kind":"class","lang":"javascript","code":"class MockXMLHttpRequest {\n constructor() {\n this.requestHeaders = {};\n this.responseHeaders = '';\n this.readyState = 0;\n this.status = 0;\n this.statusText = '';\n this.responseText = '';\n this.response = null;\n this.onreadystatechange = null;\n this.onloadend = null;\n this.upload = {\n addEventListener() {},\n };\n }\n\n open(method, url, async = true) {\n this.method = method;\n this.url = url;\n this.async = async;\n }\n\n setRequestHeader(key, value) {\n this.requestHeaders[key] = value;\n }\n\n addEventListener() {}\n\n getAllResponseHeaders() {\n return this.responseHeaders;\n }\n\n send(data) {\n this.params = data;\n requests.push(this);\n }\n\n respondWith({ status = 200, statusText = 'OK', responseText = '', responseHeaders = '' } = {}) {\n this.status = status;\n this.statusText = statusText;\n this.responseText = responseText;\n this.response = responseText;\n this.responseHeaders = responseHeaders;\n this.readyState = 4;\n\n queueMicrotask(() => {\n if (this.onloadend) {\n this.onloadend();\n } else if (this.onreadystatechange) {\n this.onreadystatechange();\n }\n });\n }\n\n abort() {}\n}"} | |
| {"repo":"axios","file":"tests/browser/defaults.browser.test.js","line":8,"symbol":"constructor","kind":"method","lang":"javascript","code":"constructor() {\n this.requestHeaders = {};\n this.responseHeaders = '';\n this.readyState = 0;\n this.status = 0;\n this.statusText = '';\n this.responseText = '';\n this.response = null;\n this.onreadystatechange = null;\n this.onloadend = null;\n this.upload = {\n addEventListener() {},\n };\n }"} | |
| {"repo":"axios","file":"tests/browser/defaults.browser.test.js","line":19,"symbol":"addEventListener","kind":"method","lang":"javascript","code":"addEventListener() {}"} | |
| {"repo":"axios","file":"tests/browser/defaults.browser.test.js","line":23,"symbol":"open","kind":"method","lang":"javascript","code":"open(method, url, async = true) {\n this.method = method;\n this.url = url;\n this.async = async;\n }"} | |
| {"repo":"axios","file":"tests/browser/defaults.browser.test.js","line":29,"symbol":"setRequestHeader","kind":"method","lang":"javascript","code":"setRequestHeader(key, value) {\n this.requestHeaders[key] = value;\n }"} | |
| {"repo":"axios","file":"tests/browser/defaults.browser.test.js","line":33,"symbol":"addEventListener","kind":"method","lang":"javascript","code":"addEventListener() {}"} | |
| {"repo":"axios","file":"tests/browser/defaults.browser.test.js","line":35,"symbol":"getAllResponseHeaders","kind":"method","lang":"javascript","code":"getAllResponseHeaders() {\n return this.responseHeaders;\n }"} | |
| {"repo":"axios","file":"tests/browser/defaults.browser.test.js","line":39,"symbol":"send","kind":"method","lang":"javascript","code":"send(data) {\n this.params = data;\n requests.push(this);\n }"} | |
| {"repo":"axios","file":"tests/browser/defaults.browser.test.js","line":44,"symbol":"respondWith","kind":"method","lang":"javascript","code":"respondWith({ status = 200, statusText = 'OK', responseText = '', responseHeaders = '' } = {}) {\n this.status = status;\n this.statusText = statusText;\n this.responseText = responseText;\n this.response = responseText;\n this.responseHeaders = responseHeaders;\n this.readyState = 4;\n\n queueMicrotask(() => {\n if (this.onloadend) {\n this.onloadend();\n } else if (this.onreadystatechange) {\n this.onreadystatechange();\n }\n });\n }"} | |
| {"repo":"axios","file":"tests/browser/defaults.browser.test.js","line":61,"symbol":"abort","kind":"method","lang":"javascript","code":"abort() {}"} | |
| {"repo":"axios","file":"tests/browser/fetchCache.browser.test.js","line":12,"symbol":"fetch","kind":"method","lang":"javascript","code":"fetch(input) {\n captured = input;\n return Promise.resolve(new Response('ok'));\n }"} | |
| {"repo":"axios","file":"tests/browser/fetchCache.browser.test.js","line":27,"symbol":"CacheDisabledRequest","kind":"class","lang":"javascript","code":"class CacheDisabledRequest extends Request {\n constructor(input, init) {\n if (init && init.cache !== undefined) {\n throw new TypeError(\"The 'cache' field on 'RequestInitializerDict' is not implemented.\");\n }\n\n super(input, init);\n capturedInit = init;\n }\n }"} | |
| {"repo":"axios","file":"tests/browser/fetchCache.browser.test.js","line":28,"symbol":"constructor","kind":"method","lang":"javascript","code":"constructor(input, init) {\n if (init && init.cache !== undefined) {\n throw new TypeError(\"The 'cache' field on 'RequestInitializerDict' is not implemented.\");\n }\n\n super(input, init);\n capturedInit = init;\n }"} | |
| {"repo":"axios","file":"tests/browser/fetchCache.browser.test.js","line":42,"symbol":"fetch","kind":"method","lang":"javascript","code":"fetch() {\n return Promise.resolve(new Response('ok'));\n }"} | |
| {"repo":"axios","file":"tests/browser/fetchResponseErrors.browser.test.js","line":12,"symbol":"WrappedResponse","kind":"class","lang":"javascript","code":"class WrappedResponse extends Response {\n async [responseType]() {\n try {\n return await super[responseType]();\n } catch (error) {\n originalError = error;\n wrappedError = new TypeError('Load failed');\n if (preserveCause) {\n wrappedError.cause = error;\n }\n throw wrappedError;\n }\n }\n }"} | |
| {"repo":"axios","file":"tests/browser/fetchResponseErrors.browser.test.js","line":35,"symbol":"fetch","kind":"method","lang":"javascript","code":"async fetch(request) {\n dispatchedRequest = request;\n // No Content-Length: enforce the limit while consuming the body.\n return new Response(\n new ReadableStream({\n start(controller) {\n controller.enqueue(new Uint8Array(1024));\n controller.close();\n },\n })\n );\n }"} | |
| {"repo":"axios","file":"tests/browser/fetchResponseErrors.browser.test.js","line":40,"symbol":"start","kind":"method","lang":"javascript","code":"start(controller) {\n controller.enqueue(new Uint8Array(1024));\n controller.close();\n }"} | |
| {"repo":"axios","file":"tests/browser/formdata.browser.test.js","line":5,"symbol":"MockXMLHttpRequest","kind":"class","lang":"javascript","code":"class MockXMLHttpRequest {\n constructor() {\n this.requestHeaders = {};\n this.responseHeaders = '';\n this.readyState = 0;\n this.status = 0;\n this.statusText = '';\n this.responseText = '';\n this.response = null;\n this.onreadystatechange = null;\n this.onloadend = null;\n this.upload = {\n addEventListener() {},\n };\n }\n\n open(method, url, async = true) {\n this.method = method;\n this.url = url;\n this.async = async;\n }\n\n setRequestHeader(key, value) {\n this.requestHeaders[key] = value;\n }\n\n addEventListener() {}\n\n getAllResponseHeaders() {\n return this.responseHeaders;\n }\n\n send(data) {\n this.params = data;\n requests.push(this);\n }\n\n respondWith({ status = 200, statusText = 'OK', responseText = '', responseHeaders = '' } = {}) {\n this.status = status;\n this.statusText = statusText;\n this.responseText = responseText;\n this.response = responseText;\n this.responseHeaders = responseHeaders;\n this.readyState = 4;\n\n queueMicrotask(() => {\n if (this.onloadend) {\n this.onloadend();\n } else if (this.onreadystatechange) {\n this.onreadystatechange();\n }\n });\n }\n\n abort() {}\n}"} | |
| {"repo":"axios","file":"tests/browser/formdata.browser.test.js","line":6,"symbol":"constructor","kind":"method","lang":"javascript","code":"constructor() {\n this.requestHeaders = {};\n this.responseHeaders = '';\n this.readyState = 0;\n this.status = 0;\n this.statusText = '';\n this.responseText = '';\n this.response = null;\n this.onreadystatechange = null;\n this.onloadend = null;\n this.upload = {\n addEventListener() {},\n };\n }"} | |
| {"repo":"axios","file":"tests/browser/formdata.browser.test.js","line":17,"symbol":"addEventListener","kind":"method","lang":"javascript","code":"addEventListener() {}"} | |
| {"repo":"axios","file":"tests/browser/formdata.browser.test.js","line":21,"symbol":"open","kind":"method","lang":"javascript","code":"open(method, url, async = true) {\n this.method = method;\n this.url = url;\n this.async = async;\n }"} | |
| {"repo":"axios","file":"tests/browser/formdata.browser.test.js","line":27,"symbol":"setRequestHeader","kind":"method","lang":"javascript","code":"setRequestHeader(key, value) {\n this.requestHeaders[key] = value;\n }"} | |
| {"repo":"axios","file":"tests/browser/formdata.browser.test.js","line":31,"symbol":"addEventListener","kind":"method","lang":"javascript","code":"addEventListener() {}"} | |
| {"repo":"axios","file":"tests/browser/formdata.browser.test.js","line":33,"symbol":"getAllResponseHeaders","kind":"method","lang":"javascript","code":"getAllResponseHeaders() {\n return this.responseHeaders;\n }"} | |
| {"repo":"axios","file":"tests/browser/formdata.browser.test.js","line":37,"symbol":"send","kind":"method","lang":"javascript","code":"send(data) {\n this.params = data;\n requests.push(this);\n }"} | |
| {"repo":"axios","file":"tests/browser/formdata.browser.test.js","line":42,"symbol":"respondWith","kind":"method","lang":"javascript","code":"respondWith({ status = 200, statusText = 'OK', responseText = '', responseHeaders = '' } = {}) {\n this.status = status;\n this.statusText = statusText;\n this.responseText = responseText;\n this.response = responseText;\n this.responseHeaders = responseHeaders;\n this.readyState = 4;\n\n queueMicrotask(() => {\n if (this.onloadend) {\n this.onloadend();\n } else if (this.onreadystatechange) {\n this.onreadystatechange();\n }\n });\n }"} | |
| {"repo":"axios","file":"tests/browser/formdata.browser.test.js","line":59,"symbol":"abort","kind":"method","lang":"javascript","code":"abort() {}"} | |
| {"repo":"axios","file":"tests/browser/headers.browser.test.js","line":5,"symbol":"MockXMLHttpRequest","kind":"class","lang":"javascript","code":"class MockXMLHttpRequest {\n constructor() {\n this.requestHeaders = {};\n this.readyState = 0;\n this.status = 0;\n this.statusText = '';\n this.responseText = '';\n this.response = null;\n this.onreadystatechange = null;\n this.onloadend = null;\n this.upload = {\n addEventListener() {},\n };\n }\n\n open(method, url, async = true) {\n this.method = method;\n this.url = url;\n this.async = async;\n }\n\n setRequestHeader(key, value) {\n this.requestHeaders[key] = value;\n }\n\n addEventListener() {}\n\n getAllResponseHeaders() {\n return '';\n }\n\n send(data) {\n this.params = data;\n requests.push(this);\n }\n\n respondWith({ status = 200, statusText = 'OK', responseText = '' } = {}) {\n this.status = status;\n this.statusText = statusText;\n this.responseText = responseText;\n this.response = responseText;\n this.readyState = 4;\n\n queueMicrotask(() => {\n if (this.onloadend) {\n this.onloadend();\n } else if (this.onreadystatechange) {\n this.onreadystatechange();\n }\n });\n }\n\n abort() {}\n}"} | |
| {"repo":"axios","file":"tests/browser/headers.browser.test.js","line":6,"symbol":"constructor","kind":"method","lang":"javascript","code":"constructor() {\n this.requestHeaders = {};\n this.readyState = 0;\n this.status = 0;\n this.statusText = '';\n this.responseText = '';\n this.response = null;\n this.onreadystatechange = null;\n this.onloadend = null;\n this.upload = {\n addEventListener() {},\n };\n }"} | |
| {"repo":"axios","file":"tests/browser/headers.browser.test.js","line":16,"symbol":"addEventListener","kind":"method","lang":"javascript","code":"addEventListener() {}"} | |
| {"repo":"axios","file":"tests/browser/headers.browser.test.js","line":20,"symbol":"open","kind":"method","lang":"javascript","code":"open(method, url, async = true) {\n this.method = method;\n this.url = url;\n this.async = async;\n }"} | |
| {"repo":"axios","file":"tests/browser/headers.browser.test.js","line":26,"symbol":"setRequestHeader","kind":"method","lang":"javascript","code":"setRequestHeader(key, value) {\n this.requestHeaders[key] = value;\n }"} | |
| {"repo":"axios","file":"tests/browser/headers.browser.test.js","line":30,"symbol":"addEventListener","kind":"method","lang":"javascript","code":"addEventListener() {}"} | |
| {"repo":"axios","file":"tests/browser/headers.browser.test.js","line":32,"symbol":"getAllResponseHeaders","kind":"method","lang":"javascript","code":"getAllResponseHeaders() {\n return '';\n }"} | |
| {"repo":"axios","file":"tests/browser/headers.browser.test.js","line":36,"symbol":"send","kind":"method","lang":"javascript","code":"send(data) {\n this.params = data;\n requests.push(this);\n }"} | |
| {"repo":"axios","file":"tests/browser/headers.browser.test.js","line":41,"symbol":"respondWith","kind":"method","lang":"javascript","code":"respondWith({ status = 200, statusText = 'OK', responseText = '' } = {}) {\n this.status = status;\n this.statusText = statusText;\n this.responseText = responseText;\n this.response = responseText;\n this.readyState = 4;\n\n queueMicrotask(() => {\n if (this.onloadend) {\n this.onloadend();\n } else if (this.onreadystatechange) {\n this.onreadystatechange();\n }\n });\n }"} | |
| {"repo":"axios","file":"tests/browser/headers.browser.test.js","line":57,"symbol":"abort","kind":"method","lang":"javascript","code":"abort() {}"} | |
| {"repo":"axios","file":"tests/browser/headers.browser.test.js","line":76,"symbol":"testHeaderValue","kind":"function","lang":"javascript","code":"function testHeaderValue(headers, key, val) {\n let found = false;\n\n for (const k in headers) {\n if (k.toLowerCase() === key.toLowerCase()) {\n found = true;\n expect(headers[k]).toBe(val);\n break;\n }\n }\n\n if (!found) {\n if (typeof val === 'undefined') {\n expect(Object.prototype.hasOwnProperty.call(headers, key)).toBe(false);\n } else {\n throw new Error(`${key} was not found in headers`);\n }\n }\n}"} | |
| {"repo":"axios","file":"tests/browser/instance.browser.test.js","line":5,"symbol":"MockXMLHttpRequest","kind":"class","lang":"javascript","code":"class MockXMLHttpRequest {\n constructor() {\n this.requestHeaders = {};\n this.responseHeaders = '';\n this.readyState = 0;\n this.status = 0;\n this.statusText = '';\n this.responseText = '';\n this.response = null;\n this.onreadystatechange = null;\n this.onloadend = null;\n this.upload = {\n addEventListener() {},\n };\n }\n\n open(method, url, async = true) {\n this.method = method;\n this.url = url;\n this.async = async;\n }\n\n setRequestHeader(key, value) {\n this.requestHeaders[key] = value;\n }\n\n addEventListener() {}\n\n getAllResponseHeaders() {\n return this.responseHeaders;\n }\n\n send(data) {\n this.params = data;\n requests.push(this);\n }\n\n respondWith({ status = 200, statusText = 'OK', responseText = '', responseHeaders = '' } = {}) {\n this.status = status;\n this.statusText = statusText;\n this.responseText = responseText;\n this.response = responseText;\n this.responseHeaders = responseHeaders;\n this.readyState = 4;\n\n queueMicrotask(() => {\n if (this.onloadend) {\n this.onloadend();\n } else if (this.onreadystatechange) {\n this.onreadystatechange();\n }\n });\n }\n}"} | |
| {"repo":"axios","file":"tests/browser/instance.browser.test.js","line":6,"symbol":"constructor","kind":"method","lang":"javascript","code":"constructor() {\n this.requestHeaders = {};\n this.responseHeaders = '';\n this.readyState = 0;\n this.status = 0;\n this.statusText = '';\n this.responseText = '';\n this.response = null;\n this.onreadystatechange = null;\n this.onloadend = null;\n this.upload = {\n addEventListener() {},\n };\n }"} | |
| {"repo":"axios","file":"tests/browser/instance.browser.test.js","line":17,"symbol":"addEventListener","kind":"method","lang":"javascript","code":"addEventListener() {}"} | |
| {"repo":"axios","file":"tests/browser/instance.browser.test.js","line":21,"symbol":"open","kind":"method","lang":"javascript","code":"open(method, url, async = true) {\n this.method = method;\n this.url = url;\n this.async = async;\n }"} | |
| {"repo":"axios","file":"tests/browser/instance.browser.test.js","line":27,"symbol":"setRequestHeader","kind":"method","lang":"javascript","code":"setRequestHeader(key, value) {\n this.requestHeaders[key] = value;\n }"} | |
| {"repo":"axios","file":"tests/browser/instance.browser.test.js","line":31,"symbol":"addEventListener","kind":"method","lang":"javascript","code":"addEventListener() {}"} | |
| {"repo":"axios","file":"tests/browser/instance.browser.test.js","line":33,"symbol":"getAllResponseHeaders","kind":"method","lang":"javascript","code":"getAllResponseHeaders() {\n return this.responseHeaders;\n }"} | |
| {"repo":"axios","file":"tests/browser/instance.browser.test.js","line":37,"symbol":"send","kind":"method","lang":"javascript","code":"send(data) {\n this.params = data;\n requests.push(this);\n }"} | |
| {"repo":"axios","file":"tests/browser/instance.browser.test.js","line":42,"symbol":"respondWith","kind":"method","lang":"javascript","code":"respondWith({ status = 200, statusText = 'OK', responseText = '', responseHeaders = '' } = {}) {\n this.status = status;\n this.statusText = statusText;\n this.responseText = responseText;\n this.response = responseText;\n this.responseHeaders = responseHeaders;\n this.readyState = 4;\n\n queueMicrotask(() => {\n if (this.onloadend) {\n this.onloadend();\n } else if (this.onreadystatechange) {\n this.onreadystatechange();\n }\n });\n }"} | |
| {"repo":"axios","file":"tests/browser/interceptors.browser.test.js","line":5,"symbol":"MockXMLHttpRequest","kind":"class","lang":"javascript","code":"class MockXMLHttpRequest {\n constructor() {\n this.requestHeaders = {};\n this.responseHeaders = {};\n this.readyState = 0;\n this.status = 0;\n this.statusText = '';\n this.responseText = '';\n this.response = null;\n this.responseURL = '';\n this.timeout = 0;\n this.withCredentials = false;\n this.onreadystatechange = null;\n this.onloadend = null;\n this.onabort = null;\n this.onerror = null;\n this.ontimeout = null;\n this.upload = {\n addEventListener() {},\n };\n }\n\n open(method, url, async = true) {\n this.method = method;\n this.url = url;\n this.async = async;\n }\n\n setRequestHeader(key, value) {\n this.requestHeaders[key] = value;\n }\n\n addEventListener() {}\n\n getAllResponseHeaders() {\n if (typeof this.responseHeaders === 'string') {\n return this.responseHeaders;\n }\n\n return Object.entries(this.responseHeaders)\n .map(([key, value]) => `${key}: ${value}`)\n .join('\\n');\n }\n\n send(data) {\n this.params = data;\n requests.push(this);\n this.readyState = 1;\n }\n\n respondWith({\n status = 200,\n statusText = 'OK',\n responseText = '',\n response = null,\n responseHeaders = {},\n head"} | |
| {"repo":"axios","file":"tests/browser/interceptors.browser.test.js","line":6,"symbol":"constructor","kind":"method","lang":"javascript","code":"constructor() {\n this.requestHeaders = {};\n this.responseHeaders = {};\n this.readyState = 0;\n this.status = 0;\n this.statusText = '';\n this.responseText = '';\n this.response = null;\n this.responseURL = '';\n this.timeout = 0;\n this.withCredentials = false;\n this.onreadystatechange = null;\n this.onloadend = null;\n this.onabort = null;\n this.onerror = null;\n this.ontimeout = null;\n this.upload = {\n addEventListener() {},\n };\n }"} | |
| {"repo":"axios","file":"tests/browser/interceptors.browser.test.js","line":23,"symbol":"addEventListener","kind":"method","lang":"javascript","code":"addEventListener() {}"} | |
| {"repo":"axios","file":"tests/browser/interceptors.browser.test.js","line":27,"symbol":"open","kind":"method","lang":"javascript","code":"open(method, url, async = true) {\n this.method = method;\n this.url = url;\n this.async = async;\n }"} | |
| {"repo":"axios","file":"tests/browser/interceptors.browser.test.js","line":33,"symbol":"setRequestHeader","kind":"method","lang":"javascript","code":"setRequestHeader(key, value) {\n this.requestHeaders[key] = value;\n }"} | |
| {"repo":"axios","file":"tests/browser/interceptors.browser.test.js","line":37,"symbol":"addEventListener","kind":"method","lang":"javascript","code":"addEventListener() {}"} | |
| {"repo":"axios","file":"tests/browser/interceptors.browser.test.js","line":39,"symbol":"getAllResponseHeaders","kind":"method","lang":"javascript","code":"getAllResponseHeaders() {\n if (typeof this.responseHeaders === 'string') {\n return this.responseHeaders;\n }\n\n return Object.entries(this.responseHeaders)\n .map(([key, value]) => `${key}: ${value}`)\n .join('\\n');\n }"} | |
| {"repo":"axios","file":"tests/browser/interceptors.browser.test.js","line":49,"symbol":"send","kind":"method","lang":"javascript","code":"send(data) {\n this.params = data;\n requests.push(this);\n this.readyState = 1;\n }"} | |
| {"repo":"axios","file":"tests/browser/interceptors.browser.test.js","line":55,"symbol":"respondWith","kind":"method","lang":"javascript","code":"respondWith({\n status = 200,\n statusText = 'OK',\n responseText = '',\n response = null,\n responseHeaders = {},\n headers = {},\n responseURL = '',\n } = {}) {\n this.status = status;\n this.statusText = statusText;\n this.responseText = responseText;\n this.response = response === null ? responseText : response;\n this.responseHeaders = Object.keys(headers).length ? headers : responseHeaders;\n this.responseURL = responseURL;\n this.readyState = 4;\n this.finish();\n }"} | |
| {"repo":"axios","file":"tests/browser/interceptors.browser.test.js","line":74,"symbol":"responseTimeout","kind":"method","lang":"javascript","code":"responseTimeout() {\n if (this.ontimeout) {\n this.ontimeout();\n }\n }"} | |
| {"repo":"axios","file":"tests/browser/interceptors.browser.test.js","line":80,"symbol":"failNetworkError","kind":"method","lang":"javascript","code":"failNetworkError(message = 'Network Error') {\n if (this.onerror) {\n this.onerror({ message });\n }\n }"} | |
| {"repo":"axios","file":"tests/browser/interceptors.browser.test.js","line":86,"symbol":"abort","kind":"method","lang":"javascript","code":"abort() {\n if (this.onabort) {\n this.onabort();\n }\n }"} | |
| {"repo":"axios","file":"tests/browser/interceptors.browser.test.js","line":92,"symbol":"finish","kind":"method","lang":"javascript","code":"finish() {\n queueMicrotask(() => {\n if (this.onloadend) {\n this.onloadend();\n } else if (this.onreadystatechange) {\n this.onreadystatechange();\n }\n });\n }"} | |
| {"repo":"axios","file":"tests/browser/options.browser.test.js","line":5,"symbol":"MockXMLHttpRequest","kind":"class","lang":"javascript","code":"class MockXMLHttpRequest {\n constructor() {\n this.requestHeaders = {};\n this.responseHeaders = '';\n this.readyState = 0;\n this.status = 0;\n this.statusText = '';\n this.responseText = '';\n this.response = null;\n this.onreadystatechange = null;\n this.onloadend = null;\n this.upload = {\n addEventListener() {},\n };\n }\n\n open(method, url, async = true) {\n this.method = method;\n this.url = url;\n this.async = async;\n }\n\n setRequestHeader(key, value) {\n this.requestHeaders[key] = value;\n }\n\n addEventListener() {}\n\n getAllResponseHeaders() {\n return this.responseHeaders;\n }\n\n send(data) {\n this.params = data;\n requests.push(this);\n }\n\n respondWith({ status = 200, statusText = 'OK', responseText = '', responseHeaders = '' } = {}) {\n this.status = status;\n this.statusText = statusText;\n this.responseText = responseText;\n this.response = responseText;\n this.responseHeaders = responseHeaders;\n this.readyState = 4;\n\n queueMicrotask(() => {\n if (this.onloadend) {\n this.onloadend();\n } else if (this.onreadystatechange) {\n this.onreadystatechange();\n }\n });\n }\n}"} | |
| {"repo":"axios","file":"tests/browser/options.browser.test.js","line":6,"symbol":"constructor","kind":"method","lang":"javascript","code":"constructor() {\n this.requestHeaders = {};\n this.responseHeaders = '';\n this.readyState = 0;\n this.status = 0;\n this.statusText = '';\n this.responseText = '';\n this.response = null;\n this.onreadystatechange = null;\n this.onloadend = null;\n this.upload = {\n addEventListener() {},\n };\n }"} | |
| {"repo":"axios","file":"tests/browser/options.browser.test.js","line":17,"symbol":"addEventListener","kind":"method","lang":"javascript","code":"addEventListener() {}"} | |
| {"repo":"axios","file":"tests/browser/options.browser.test.js","line":21,"symbol":"open","kind":"method","lang":"javascript","code":"open(method, url, async = true) {\n this.method = method;\n this.url = url;\n this.async = async;\n }"} | |
| {"repo":"axios","file":"tests/browser/options.browser.test.js","line":27,"symbol":"setRequestHeader","kind":"method","lang":"javascript","code":"setRequestHeader(key, value) {\n this.requestHeaders[key] = value;\n }"} | |
| {"repo":"axios","file":"tests/browser/options.browser.test.js","line":31,"symbol":"addEventListener","kind":"method","lang":"javascript","code":"addEventListener() {}"} | |
| {"repo":"axios","file":"tests/browser/options.browser.test.js","line":33,"symbol":"getAllResponseHeaders","kind":"method","lang":"javascript","code":"getAllResponseHeaders() {\n return this.responseHeaders;\n }"} | |
| {"repo":"axios","file":"tests/browser/options.browser.test.js","line":37,"symbol":"send","kind":"method","lang":"javascript","code":"send(data) {\n this.params = data;\n requests.push(this);\n }"} | |
| {"repo":"axios","file":"tests/browser/options.browser.test.js","line":42,"symbol":"respondWith","kind":"method","lang":"javascript","code":"respondWith({ status = 200, statusText = 'OK', responseText = '', responseHeaders = '' } = {}) {\n this.status = status;\n this.statusText = statusText;\n this.responseText = responseText;\n this.response = responseText;\n this.responseHeaders = responseHeaders;\n this.readyState = 4;\n\n queueMicrotask(() => {\n if (this.onloadend) {\n this.onloadend();\n } else if (this.onreadystatechange) {\n this.onreadystatechange();\n }\n });\n }"} | |
| {"repo":"axios","file":"tests/browser/progress.browser.test.js","line":7,"symbol":"ProgressEventTarget","kind":"class","lang":"javascript","doc":"Real EventTarget + ProgressEvent dispatches so events keep genuine browser semantics: `target` survives the dispatch, `currentTarget` does not.","code":"class ProgressEventTarget extends EventTarget {\n constructor() {\n super();\n this._listenerCounts = {};\n }\n\n addEventListener(type, listener, options) {\n this._listenerCounts[type] = (this._listenerCounts[type] || 0) + 1;\n super.addEventListener(type, listener, options);\n }\n}"} | |
| {"repo":"axios","file":"tests/browser/progress.browser.test.js","line":8,"symbol":"constructor","kind":"method","lang":"javascript","code":"constructor() {\n super();\n this._listenerCounts = {};\n }"} | |
| {"repo":"axios","file":"tests/browser/progress.browser.test.js","line":13,"symbol":"addEventListener","kind":"method","lang":"javascript","code":"addEventListener(type, listener, options) {\n this._listenerCounts[type] = (this._listenerCounts[type] || 0) + 1;\n super.addEventListener(type, listener, options);\n }"} | |
| {"repo":"axios","file":"tests/browser/progress.browser.test.js","line":19,"symbol":"MockXMLHttpRequest","kind":"class","lang":"javascript","code":"class MockXMLHttpRequest extends ProgressEventTarget {\n constructor() {\n super();\n this.requestHeaders = {};\n this.responseHeaders = {};\n this.readyState = 0;\n this.status = 0;\n this.statusText = '';\n this.responseText = '';\n this.response = null;\n this.timeout = 0;\n this.withCredentials = false;\n this.onreadystatechange = null;\n this.onloadend = null;\n this.onabort = null;\n this.onerror = null;\n this.ontimeout = null;\n this.upload = new ProgressEventTarget();\n // like a real XHR, invoke the onloadend property while loadend dispatches\n this.addEventListener('loadend', (event) => {\n this.onloadend && this.onloadend(event);\n });\n }\n\n open(method, url, async = true) {\n this.method = method;\n this.url = url;\n this.async = async;\n }\n\n setRequestHeader(key, value) {\n this.requestHeaders[key] = value;\n }\n\n getAllResponseHeaders() {\n return Object.entries(this.responseHeaders)\n .map(([key, value]) => `${key}: ${value}`)\n .join('\\n');\n }\n\n send(data) {\n this.params = data;\n this.readyState = 1;\n requests.push(this);\n }\n\n abort() {\n this.aborted = true;\n this.readyState = 0;\n t"} | |
| {"repo":"axios","file":"tests/browser/progress.browser.test.js","line":20,"symbol":"constructor","kind":"method","lang":"javascript","code":"constructor() {\n super();\n this.requestHeaders = {};\n this.responseHeaders = {};\n this.readyState = 0;\n this.status = 0;\n this.statusText = '';\n this.responseText = '';\n this.response = null;\n this.timeout = 0;\n this.withCredentials = false;\n this.onreadystatechange = null;\n this.onloadend = null;\n this.onabort = null;\n this.onerror = null;\n this.ontimeout = null;\n this.upload = new ProgressEventTarget();\n // like a real XHR, invoke the onloadend property while loadend dispatches\n this.addEventListener('loadend', (event) => {\n this.onloadend && this.onloadend(event);\n });\n }"} | |
| {"repo":"axios","file":"tests/browser/progress.browser.test.js","line":43,"symbol":"open","kind":"method","lang":"javascript","code":"open(method, url, async = true) {\n this.method = method;\n this.url = url;\n this.async = async;\n }"} | |
| {"repo":"axios","file":"tests/browser/progress.browser.test.js","line":49,"symbol":"setRequestHeader","kind":"method","lang":"javascript","code":"setRequestHeader(key, value) {\n this.requestHeaders[key] = value;\n }"} | |
| {"repo":"axios","file":"tests/browser/progress.browser.test.js","line":53,"symbol":"getAllResponseHeaders","kind":"method","lang":"javascript","code":"getAllResponseHeaders() {\n return Object.entries(this.responseHeaders)\n .map(([key, value]) => `${key}: ${value}`)\n .join('\\n');\n }"} | |
| {"repo":"axios","file":"tests/browser/progress.browser.test.js","line":59,"symbol":"send","kind":"method","lang":"javascript","code":"send(data) {\n this.params = data;\n this.readyState = 1;\n requests.push(this);\n }"} | |
| {"repo":"axios","file":"tests/browser/progress.browser.test.js","line":65,"symbol":"abort","kind":"method","lang":"javascript","code":"abort() {\n this.aborted = true;\n this.readyState = 0;\n this.status = 0;\n }"} | |
| {"repo":"axios","file":"tests/browser/progress.browser.test.js","line":71,"symbol":"getListenerCount","kind":"method","lang":"javascript","code":"getListenerCount(type, target = 'request') {\n const eventTarget = target === 'upload' ? this.upload : this;\n return eventTarget._listenerCounts[type] || 0;\n }"} | |
| {"repo":"axios","file":"tests/browser/progress.browser.test.js","line":76,"symbol":"emit","kind":"method","lang":"javascript","code":"emit(type, target = 'request', init = {}) {\n const eventTarget = target === 'upload' ? this.upload : this;\n eventTarget.dispatchEvent(new ProgressEvent(type, init));\n }"} | |
| {"repo":"axios","file":"tests/browser/progress.browser.test.js","line":81,"symbol":"respondWith","kind":"method","lang":"javascript","code":"respondWith({\n status = 200,\n statusText = 'OK',\n responseText = '',\n response = null,\n headers = {},\n } = {}) {\n this.status = status;\n this.statusText = statusText;\n this.responseText = responseText;\n this.response = response;\n this.responseHeaders = headers;\n this.readyState = 4;\n\n this.emit('progress', 'request', {\n loaded: responseText.length,\n total: responseText.length,\n lengthComputable: true,\n });\n\n queueMicrotask(() => {\n if (this.onloadend) {\n this.emit('loadend', 'request', {\n loaded: this.responseText.length,\n total: this.responseText.length,\n lengthComputable: true,\n });\n } else if (this.onreadystatechange) {\n this.onreadystatechange();\n }\n });\n }"} | |
| {"repo":"axios","file":"tests/browser/progress.browser.test.js","line":298,"symbol":"constructor","kind":"method","lang":"javascript","code":"constructor() {\n super();\n delete this.onloadend;\n }"} | |
| {"repo":"axios","file":"tests/browser/promise.browser.test.js","line":5,"symbol":"MockXMLHttpRequest","kind":"class","lang":"javascript","code":"class MockXMLHttpRequest {\n constructor() {\n this.requestHeaders = {};\n this.responseHeaders = '';\n this.readyState = 0;\n this.status = 0;\n this.statusText = '';\n this.responseText = '';\n this.response = null;\n this.onreadystatechange = null;\n this.onloadend = null;\n this.upload = {\n addEventListener() {},\n };\n }\n\n open(method, url, async = true) {\n this.method = method;\n this.url = url;\n this.async = async;\n }\n\n setRequestHeader(key, value) {\n this.requestHeaders[key] = value;\n }\n\n addEventListener() {}\n\n getAllResponseHeaders() {\n return this.responseHeaders;\n }\n\n send(data) {\n this.params = data;\n requests.push(this);\n }\n\n respondWith({ status = 200, statusText = 'OK', responseText = '', responseHeaders = '' } = {}) {\n this.status = status;\n this.statusText = statusText;\n this.responseText = responseText;\n this.response = responseText;\n this.responseHeaders = responseHeaders;\n this.readyState = 4;\n\n queueMicrotask(() => {\n if (this.onloadend) {\n this.onloadend();\n } else if (this.onreadystatechange) {\n this.onreadystatechange();\n }\n });\n }\n\n abort() {}\n}"} | |
| {"repo":"axios","file":"tests/browser/promise.browser.test.js","line":6,"symbol":"constructor","kind":"method","lang":"javascript","code":"constructor() {\n this.requestHeaders = {};\n this.responseHeaders = '';\n this.readyState = 0;\n this.status = 0;\n this.statusText = '';\n this.responseText = '';\n this.response = null;\n this.onreadystatechange = null;\n this.onloadend = null;\n this.upload = {\n addEventListener() {},\n };\n }"} | |
| {"repo":"axios","file":"tests/browser/promise.browser.test.js","line":17,"symbol":"addEventListener","kind":"method","lang":"javascript","code":"addEventListener() {}"} | |
| {"repo":"axios","file":"tests/browser/promise.browser.test.js","line":21,"symbol":"open","kind":"method","lang":"javascript","code":"open(method, url, async = true) {\n this.method = method;\n this.url = url;\n this.async = async;\n }"} | |
| {"repo":"axios","file":"tests/browser/promise.browser.test.js","line":27,"symbol":"setRequestHeader","kind":"method","lang":"javascript","code":"setRequestHeader(key, value) {\n this.requestHeaders[key] = value;\n }"} | |
| {"repo":"axios","file":"tests/browser/promise.browser.test.js","line":31,"symbol":"addEventListener","kind":"method","lang":"javascript","code":"addEventListener() {}"} | |
| {"repo":"axios","file":"tests/browser/promise.browser.test.js","line":33,"symbol":"getAllResponseHeaders","kind":"method","lang":"javascript","code":"getAllResponseHeaders() {\n return this.responseHeaders;\n }"} | |
| {"repo":"axios","file":"tests/browser/promise.browser.test.js","line":37,"symbol":"send","kind":"method","lang":"javascript","code":"send(data) {\n this.params = data;\n requests.push(this);\n }"} | |
| {"repo":"axios","file":"tests/browser/promise.browser.test.js","line":42,"symbol":"respondWith","kind":"method","lang":"javascript","code":"respondWith({ status = 200, statusText = 'OK', responseText = '', responseHeaders = '' } = {}) {\n this.status = status;\n this.statusText = statusText;\n this.responseText = responseText;\n this.response = responseText;\n this.responseHeaders = responseHeaders;\n this.readyState = 4;\n\n queueMicrotask(() => {\n if (this.onloadend) {\n this.onloadend();\n } else if (this.onreadystatechange) {\n this.onreadystatechange();\n }\n });\n }"} | |
| {"repo":"axios","file":"tests/browser/promise.browser.test.js","line":59,"symbol":"abort","kind":"method","lang":"javascript","code":"abort() {}"} | |
| {"repo":"axios","file":"tests/browser/requests.browser.test.js","line":6,"symbol":"MockXMLHttpRequest","kind":"class","lang":"javascript","code":"class MockXMLHttpRequest {\n constructor() {\n this.requestHeaders = {};\n this.responseHeaders = {};\n this.readyState = 0;\n this.status = 0;\n this.statusText = '';\n this.responseText = '';\n this.response = null;\n this.responseURL = '';\n this.timeout = 0;\n this.withCredentials = false;\n this.onreadystatechange = null;\n this.onloadend = null;\n this.onabort = null;\n this.onerror = null;\n this.ontimeout = null;\n this.upload = {\n addEventListener() {},\n };\n }\n\n open(method, url, async = true) {\n this.method = method;\n this.url = url;\n this.async = async;\n }\n\n setRequestHeader(key, value) {\n this.requestHeaders[key] = value;\n }\n\n addEventListener() {}\n\n getAllResponseHeaders() {\n return Object.entries(this.responseHeaders)\n .map(([key, value]) => `${key}: ${value}`)\n .join('\\n');\n }\n\n send(data) {\n this.params = data;\n this.readyState = 1;\n requests.push(this);\n }\n\n respondWith({\n status = 200,\n statusText = 'OK',\n responseText = '',\n response = null,\n headers = {},\n responseURL = '',\n } = {}) {\n this.status = status;\n this.statusText = statusText;\n this.respons"} | |
| {"repo":"axios","file":"tests/browser/requests.browser.test.js","line":7,"symbol":"constructor","kind":"method","lang":"javascript","code":"constructor() {\n this.requestHeaders = {};\n this.responseHeaders = {};\n this.readyState = 0;\n this.status = 0;\n this.statusText = '';\n this.responseText = '';\n this.response = null;\n this.responseURL = '';\n this.timeout = 0;\n this.withCredentials = false;\n this.onreadystatechange = null;\n this.onloadend = null;\n this.onabort = null;\n this.onerror = null;\n this.ontimeout = null;\n this.upload = {\n addEventListener() {},\n };\n }"} | |
| {"repo":"axios","file":"tests/browser/requests.browser.test.js","line":24,"symbol":"addEventListener","kind":"method","lang":"javascript","code":"addEventListener() {}"} | |
| {"repo":"axios","file":"tests/browser/requests.browser.test.js","line":28,"symbol":"open","kind":"method","lang":"javascript","code":"open(method, url, async = true) {\n this.method = method;\n this.url = url;\n this.async = async;\n }"} | |
| {"repo":"axios","file":"tests/browser/requests.browser.test.js","line":34,"symbol":"setRequestHeader","kind":"method","lang":"javascript","code":"setRequestHeader(key, value) {\n this.requestHeaders[key] = value;\n }"} | |
| {"repo":"axios","file":"tests/browser/requests.browser.test.js","line":38,"symbol":"addEventListener","kind":"method","lang":"javascript","code":"addEventListener() {}"} | |
| {"repo":"axios","file":"tests/browser/requests.browser.test.js","line":40,"symbol":"getAllResponseHeaders","kind":"method","lang":"javascript","code":"getAllResponseHeaders() {\n return Object.entries(this.responseHeaders)\n .map(([key, value]) => `${key}: ${value}`)\n .join('\\n');\n }"} | |
| {"repo":"axios","file":"tests/browser/requests.browser.test.js","line":46,"symbol":"send","kind":"method","lang":"javascript","code":"send(data) {\n this.params = data;\n this.readyState = 1;\n requests.push(this);\n }"} | |
| {"repo":"axios","file":"tests/browser/requests.browser.test.js","line":52,"symbol":"respondWith","kind":"method","lang":"javascript","code":"respondWith({\n status = 200,\n statusText = 'OK',\n responseText = '',\n response = null,\n headers = {},\n responseURL = '',\n } = {}) {\n this.status = status;\n this.statusText = statusText;\n this.responseText = responseText;\n this.response = response;\n this.responseHeaders = headers;\n this.responseURL = responseURL;\n this.readyState = 4;\n this.finish();\n }"} | |
| {"repo":"axios","file":"tests/browser/requests.browser.test.js","line":70,"symbol":"responseTimeout","kind":"method","lang":"javascript","code":"responseTimeout() {\n if (this.ontimeout) {\n this.ontimeout();\n }\n }"} | |
| {"repo":"axios","file":"tests/browser/requests.browser.test.js","line":76,"symbol":"failNetworkError","kind":"method","lang":"javascript","code":"failNetworkError(message = 'Network Error') {\n if (this.onerror) {\n this.onerror({ message });\n }\n }"} | |
| {"repo":"axios","file":"tests/browser/requests.browser.test.js","line":82,"symbol":"abort","kind":"method","lang":"javascript","code":"abort() {\n if (this.onabort) {\n this.onabort();\n }\n }"} | |
| {"repo":"axios","file":"tests/browser/requests.browser.test.js","line":88,"symbol":"finish","kind":"method","lang":"javascript","code":"finish() {\n queueMicrotask(() => {\n if (this.onloadend) {\n this.onloadend();\n } else if (this.onreadystatechange) {\n this.onreadystatechange();\n }\n });\n }"} | |
| {"repo":"axios","file":"tests/browser/requests.browser.test.js","line":262,"symbol":"validateStatus","kind":"method","lang":"javascript","code":"validateStatus(status) {\n return status !== 500;\n }"} | |
| {"repo":"axios","file":"tests/browser/requests.browser.test.js","line":279,"symbol":"validateStatus","kind":"method","lang":"javascript","code":"validateStatus(status) {\n return status === 500;\n }"} | |
| {"repo":"axios","file":"tests/browser/transform.browser.test.js","line":6,"symbol":"MockXMLHttpRequest","kind":"class","lang":"javascript","code":"class MockXMLHttpRequest {\n constructor() {\n this.requestHeaders = {};\n this.responseHeaders = '';\n this.readyState = 0;\n this.status = 0;\n this.statusText = '';\n this.responseText = '';\n this.response = null;\n this.timeout = 0;\n this.onreadystatechange = null;\n this.onloadend = null;\n this.onabort = null;\n this.onerror = null;\n this.ontimeout = null;\n this.upload = {\n addEventListener() {},\n };\n }\n\n open(method, url, async = true) {\n this.method = method;\n this.url = url;\n this.async = async;\n }\n\n setRequestHeader(key, value) {\n this.requestHeaders[key] = value;\n }\n\n addEventListener() {}\n\n getAllResponseHeaders() {\n return this.responseHeaders;\n }\n\n send(data) {\n this.params = data;\n requests.push(this);\n }\n\n respondWith({ status = 200, statusText = 'OK', responseText = '', responseHeaders = '' } = {}) {\n this.status = status;\n this.statusText = statusText;\n this.responseText = responseText;\n this.response = responseText;\n this.responseHeaders = responseHeaders;\n this.readyState = 4;\n\n queueMicrotask(() => {\n if (this.onloadend) {\n this.onloadend();\n } else if "} | |
| {"repo":"axios","file":"tests/browser/transform.browser.test.js","line":7,"symbol":"constructor","kind":"method","lang":"javascript","code":"constructor() {\n this.requestHeaders = {};\n this.responseHeaders = '';\n this.readyState = 0;\n this.status = 0;\n this.statusText = '';\n this.responseText = '';\n this.response = null;\n this.timeout = 0;\n this.onreadystatechange = null;\n this.onloadend = null;\n this.onabort = null;\n this.onerror = null;\n this.ontimeout = null;\n this.upload = {\n addEventListener() {},\n };\n }"} | |
| {"repo":"axios","file":"tests/browser/transform.browser.test.js","line":22,"symbol":"addEventListener","kind":"method","lang":"javascript","code":"addEventListener() {}"} | |
| {"repo":"axios","file":"tests/browser/transform.browser.test.js","line":26,"symbol":"open","kind":"method","lang":"javascript","code":"open(method, url, async = true) {\n this.method = method;\n this.url = url;\n this.async = async;\n }"} | |
| {"repo":"axios","file":"tests/browser/transform.browser.test.js","line":32,"symbol":"setRequestHeader","kind":"method","lang":"javascript","code":"setRequestHeader(key, value) {\n this.requestHeaders[key] = value;\n }"} | |
| {"repo":"axios","file":"tests/browser/transform.browser.test.js","line":36,"symbol":"addEventListener","kind":"method","lang":"javascript","code":"addEventListener() {}"} | |
| {"repo":"axios","file":"tests/browser/transform.browser.test.js","line":38,"symbol":"getAllResponseHeaders","kind":"method","lang":"javascript","code":"getAllResponseHeaders() {\n return this.responseHeaders;\n }"} | |
| {"repo":"axios","file":"tests/browser/transform.browser.test.js","line":42,"symbol":"send","kind":"method","lang":"javascript","code":"send(data) {\n this.params = data;\n requests.push(this);\n }"} | |
| {"repo":"axios","file":"tests/browser/transform.browser.test.js","line":47,"symbol":"respondWith","kind":"method","lang":"javascript","code":"respondWith({ status = 200, statusText = 'OK', responseText = '', responseHeaders = '' } = {}) {\n this.status = status;\n this.statusText = statusText;\n this.responseText = responseText;\n this.response = responseText;\n this.responseHeaders = responseHeaders;\n this.readyState = 4;\n\n queueMicrotask(() => {\n if (this.onloadend) {\n this.onloadend();\n } else if (this.onreadystatechange) {\n this.onreadystatechange();\n }\n });\n }"} | |
| {"repo":"axios","file":"tests/browser/transform.browser.test.js","line":64,"symbol":"abort","kind":"method","lang":"javascript","code":"abort() {}"} | |
| {"repo":"axios","file":"tests/browser/transform.browser.test.js","line":178,"symbol":"transformRequest","kind":"method","lang":"javascript","code":"transformRequest(data) {\n return data;\n }"} | |
| {"repo":"axios","file":"tests/browser/transform.browser.test.js","line":212,"symbol":"transformRequest","kind":"method","lang":"javascript","code":"transformRequest(data, headers) {\n headers['X-Authorization'] = token;\n return data;\n }"} | |
| {"repo":"axios","file":"tests/browser/xsrf.browser.test.js","line":6,"symbol":"MockXMLHttpRequest","kind":"class","lang":"javascript","code":"class MockXMLHttpRequest {\n constructor() {\n this.requestHeaders = {};\n this.readyState = 0;\n this.status = 200;\n this.statusText = 'OK';\n this.responseText = '';\n this.timeout = 0;\n this.onreadystatechange = null;\n this.onloadend = null;\n this.onabort = null;\n this.onerror = null;\n this.ontimeout = null;\n this.upload = {\n addEventListener() {},\n };\n }\n\n open(method, url, async = true) {\n this.method = method;\n this.url = url;\n this.async = async;\n }\n\n setRequestHeader(key, value) {\n this.requestHeaders[key] = value;\n }\n\n addEventListener() {}\n\n getAllResponseHeaders() {\n return '';\n }\n\n send() {\n requests.push(this);\n this.readyState = 4;\n\n queueMicrotask(() => {\n if (this.onloadend) {\n this.onloadend();\n } else if (this.onreadystatechange) {\n this.onreadystatechange();\n }\n });\n }\n\n abort() {}\n}"} | |
| {"repo":"axios","file":"tests/browser/xsrf.browser.test.js","line":7,"symbol":"constructor","kind":"method","lang":"javascript","code":"constructor() {\n this.requestHeaders = {};\n this.readyState = 0;\n this.status = 200;\n this.statusText = 'OK';\n this.responseText = '';\n this.timeout = 0;\n this.onreadystatechange = null;\n this.onloadend = null;\n this.onabort = null;\n this.onerror = null;\n this.ontimeout = null;\n this.upload = {\n addEventListener() {},\n };\n }"} | |
| {"repo":"axios","file":"tests/browser/xsrf.browser.test.js","line":20,"symbol":"addEventListener","kind":"method","lang":"javascript","code":"addEventListener() {}"} | |
| {"repo":"axios","file":"tests/browser/xsrf.browser.test.js","line":24,"symbol":"open","kind":"method","lang":"javascript","code":"open(method, url, async = true) {\n this.method = method;\n this.url = url;\n this.async = async;\n }"} | |
| {"repo":"axios","file":"tests/browser/xsrf.browser.test.js","line":30,"symbol":"setRequestHeader","kind":"method","lang":"javascript","code":"setRequestHeader(key, value) {\n this.requestHeaders[key] = value;\n }"} | |
| {"repo":"axios","file":"tests/browser/xsrf.browser.test.js","line":34,"symbol":"addEventListener","kind":"method","lang":"javascript","code":"addEventListener() {}"} | |
| {"repo":"axios","file":"tests/browser/xsrf.browser.test.js","line":36,"symbol":"getAllResponseHeaders","kind":"method","lang":"javascript","code":"getAllResponseHeaders() {\n return '';\n }"} | |
| {"repo":"axios","file":"tests/browser/xsrf.browser.test.js","line":40,"symbol":"send","kind":"method","lang":"javascript","code":"send() {\n requests.push(this);\n this.readyState = 4;\n\n queueMicrotask(() => {\n if (this.onloadend) {\n this.onloadend();\n } else if (this.onreadystatechange) {\n this.onreadystatechange();\n }\n });\n }"} | |
| {"repo":"axios","file":"tests/browser/xsrf.browser.test.js","line":53,"symbol":"abort","kind":"method","lang":"javascript","code":"abort() {}"} | |
| {"repo":"axios","file":"tests/module/cjs/tests/helpers/cjs-added-types.ts","line":3,"symbol":"headers","kind":"constant","lang":"typescript","code":"const headers = new axios.AxiosHeaders();"} | |
| {"repo":"axios","file":"tests/module/cjs/tests/helpers/cjs-added-types.ts","line":4,"symbol":"iterableHeaders","kind":"constant","lang":"typescript","code":"const iterableHeaders: Iterable<[string, axios.AxiosHeaderValue]> = [['x-test', 'ok']];"} | |
| {"repo":"axios","file":"tests/module/cjs/tests/helpers/cjs-added-types.ts","line":6,"symbol":"serializedHeaders","kind":"constant","lang":"typescript","code":"const serializedHeaders: string = headers.toString();"} | |
| {"repo":"axios","file":"tests/module/cjs/tests/helpers/cjs-added-types.ts","line":7,"symbol":"parsedParameters","kind":"constant","lang":"typescript","code":"const parsedParameters: axios.AxiosHeaderParameters = axios.AxiosHeaders.parseParameters(\n 'multipart/form-data; boundary=\"test\"'\n);"} | |
| {"repo":"axios","file":"tests/module/cjs/tests/helpers/cjs-added-types.ts","line":11,"symbol":"parsedHeaderParameters","kind":"constant","lang":"typescript","code":"const parsedHeaderParameters: axios.AxiosHeaderParameters = headers.get(\n 'content-type',\n axios.AxiosHeaders.parseParameters\n);"} | |
| {"repo":"axios","file":"tests/module/cjs/tests/helpers/cjs-added-types.ts","line":16,"symbol":"source","kind":"constant","lang":"typescript","code":"const source = axios.CancelToken.source();"} | |
| {"repo":"axios","file":"tests/module/cjs/tests/helpers/cjs-added-types.ts","line":18,"symbol":"message","kind":"constant","lang":"typescript","code":"const message: string | undefined = cancel && cancel.message;"} | |
| {"repo":"axios","file":"tests/module/cjs/tests/helpers/cjs-added-types.ts","line":22,"symbol":"signal","kind":"constant","lang":"typescript","code":"const signal: AbortSignal = source.token.toAbortSignal();"} | |
| {"repo":"axios","file":"tests/module/cjs/tests/helpers/cjs-added-types.ts","line":24,"symbol":"cancel","kind":"constant","lang":"typescript","code":"const cancel = new axios.CanceledError<{ ok: true }>(\n 'stop',\n {} as axios.InternalAxiosRequestConfig,\n {}\n);"} | |
| {"repo":"axios","file":"tests/module/cjs/tests/helpers/cjs-added-types.ts","line":29,"symbol":"cancelFlag","kind":"constant","lang":"typescript","code":"const cancelFlag: boolean | undefined = cancel.__CANCEL__;"} | |
| {"repo":"axios","file":"tests/module/cjs/tests/helpers/cjs-added-types.ts","line":30,"symbol":"cancelCtor","kind":"constant","lang":"typescript","code":"const cancelCtor: typeof axios.CanceledError = axios.Cancel;"} | |
| {"repo":"axios","file":"tests/module/cjs/tests/helpers/cjs-added-types.ts","line":31,"symbol":"cancelFromAlias","kind":"constant","lang":"typescript","code":"const cancelFromAlias = new cancelCtor('from alias');"} | |
| {"repo":"axios","file":"tests/module/cjs/tests/helpers/cjs-added-types.ts","line":33,"symbol":"status","kind":"constant","lang":"typescript","code":"const status = axios.HttpStatusCode.WebServerIsDown;"} | |
| {"repo":"axios","file":"tests/module/cjs/tests/helpers/cjs-added-types.ts","line":34,"symbol":"unknownErrorStatus","kind":"constant","lang":"typescript","code":"const unknownErrorStatus = axios.HttpStatusCode.WebServerReturnsAnUnknownError;"} | |
| {"repo":"axios","file":"tests/module/cjs/tests/helpers/cjs-added-types.ts","line":35,"symbol":"contentTooLargeStatus","kind":"constant","lang":"typescript","code":"const contentTooLargeStatus = axios.HttpStatusCode.ContentTooLarge;"} | |
| {"repo":"axios","file":"tests/module/cjs/tests/helpers/cjs-added-types.ts","line":36,"symbol":"unprocessableContentStatus","kind":"constant","lang":"typescript","code":"const unprocessableContentStatus = axios.HttpStatusCode.UnprocessableContent;"} | |
| {"repo":"axios","file":"tests/module/cjs/tests/helpers/cjs-added-types.ts","line":38,"symbol":"CustomBlob","kind":"class","lang":"typescript","code":"class CustomBlob {\n constructor(_parts?: any[]) {}\n}"} | |
| {"repo":"axios","file":"tests/module/cjs/tests/helpers/cjs-added-types.ts","line":39,"symbol":"constructor","kind":"method","lang":"typescript","code":"constructor(_parts?: any[]) {}"} | |
| {"repo":"axios","file":"tests/module/cjs/tests/helpers/cjs-added-types.ts","line":42,"symbol":"serializerOptions","kind":"constant","lang":"typescript","code":"const serializerOptions: axios.FormSerializerOptions = {\n maxDepth: 2,\n Blob: CustomBlob,\n};"} | |
| {"repo":"axios","file":"tests/module/cjs/tests/helpers/cjs-added-types.ts","line":49,"symbol":"SearchBody","kind":"interface","lang":"typescript","code":"interface SearchBody {\n includeArchived: boolean;\n}"} | |
| {"repo":"axios","file":"tests/module/cjs/tests/helpers/cjs-added-types.ts","line":53,"symbol":"SearchParams","kind":"interface","lang":"typescript","code":"interface SearchParams {\n query: string;\n page?: number;\n}"} | |
| {"repo":"axios","file":"tests/module/cjs/tests/helpers/cjs-added-types.ts","line":58,"symbol":"paramsConfig","kind":"constant","lang":"typescript","code":"const paramsConfig: axios.AxiosRequestConfig<SearchBody, SearchParams> = {\n data: { includeArchived: false },\n params: { query: 'axios', page: 1 },\n paramsSerializer: (params) => {\n const query: string = params.query;\n const page: number | undefined = params.page;\n // @ts-expect-error -- serializer params use the request params type\n const invalidQuery: number = params.query;\n void invalidQuery;\n return `${query}:${page ?? 1}`;\n },\n withXSRFToken: (config) => config.params?.query === 'axios',\n};"} | |
| {"repo":"axios","file":"tests/module/cjs/tests/helpers/cjs-added-types.ts","line":62,"symbol":"query","kind":"constant","lang":"typescript","code":"const query: string = params.query;"} | |
| {"repo":"axios","file":"tests/module/cjs/tests/helpers/cjs-added-types.ts","line":63,"symbol":"page","kind":"constant","lang":"typescript","code":"const page: number | undefined = params.page;"} | |
| {"repo":"axios","file":"tests/module/cjs/tests/helpers/cjs-added-types.ts","line":65,"symbol":"invalidQuery","kind":"constant","lang":"typescript","doc":"@ts-expect-error -- serializer params use the request params type","code":"const invalidQuery: number = params.query;"} | |
| {"repo":"axios","file":"tests/module/cjs/tests/helpers/cjs-added-types.ts","line":72,"symbol":"customParamsSerializer","kind":"constant","lang":"typescript","code":"const customParamsSerializer: axios.CustomParamsSerializer<SearchParams> = (params) => params.query;"} | |
| {"repo":"axios","file":"tests/module/cjs/tests/helpers/cjs-added-types.ts","line":73,"symbol":"rawParamsConfig","kind":"constant","lang":"typescript","code":"const rawParamsConfig: axios.RawAxiosRequestConfig<SearchBody, SearchParams> = paramsConfig;"} | |
| {"repo":"axios","file":"tests/module/cjs/tests/helpers/cjs-added-types.ts","line":74,"symbol":"internalParamsConfig","kind":"constant","lang":"typescript","code":"const internalParamsConfig = {\n ...paramsConfig,\n headers: new axios.AxiosHeaders(),\n} as axios.InternalAxiosRequestConfig<SearchBody, SearchParams>;"} | |
| {"repo":"axios","file":"tests/module/cjs/tests/helpers/cjs-added-types.ts","line":78,"symbol":"paramsResponse","kind":"constant","lang":"typescript","code":"const paramsResponse = {} as axios.AxiosResponse<unknown, SearchBody, {}, SearchParams>;"} | |
| {"repo":"axios","file":"tests/module/cjs/tests/helpers/cjs-added-types.ts","line":79,"symbol":"paramsError","kind":"constant","lang":"typescript","code":"const paramsError = {} as axios.AxiosError<unknown, SearchBody, SearchParams>;"} | |
| {"repo":"axios","file":"tests/module/cjs/tests/helpers/cjs-added-types.ts","line":80,"symbol":"paramsPromise","kind":"constant","lang":"typescript","code":"const paramsPromise: axios.AxiosPromise<unknown, SearchBody, SearchParams>;"} | |
| {"repo":"axios","file":"tests/module/cjs/tests/helpers/cjs-added-types.ts","line":82,"symbol":"internalQuery","kind":"constant","lang":"typescript","code":"const internalQuery: string = internalParamsConfig.params!.query;"} | |
| {"repo":"axios","file":"tests/module/cjs/tests/helpers/cjs-added-types.ts","line":83,"symbol":"responseQuery","kind":"constant","lang":"typescript","code":"const responseQuery: string = paramsResponse.config.params!.query;"} | |
| {"repo":"axios","file":"tests/module/cjs/tests/helpers/cjs-added-types.ts","line":84,"symbol":"errorQuery","kind":"constant","lang":"typescript","code":"const errorQuery: string = paramsError.config!.params!.query;"} | |
| {"repo":"axios","file":"tests/module/cjs/tests/helpers/cjs-added-types.ts","line":87,"symbol":"promiseData","kind":"constant","lang":"typescript","code":"const promiseData: SearchBody | undefined = response.config.data;"} | |
| {"repo":"axios","file":"tests/module/cjs/tests/helpers/cjs-added-types.ts","line":88,"symbol":"promiseParams","kind":"constant","lang":"typescript","code":"const promiseParams: SearchParams | undefined = response.config.params;"} | |
| {"repo":"axios","file":"tests/module/cjs/tests/helpers/cjs-added-types.ts","line":90,"symbol":"invalidPromiseData","kind":"constant","lang":"typescript","doc":"@ts-expect-error -- AxiosPromise preserves the request data type","code":"const invalidPromiseData: { includeArchived: string } | undefined = response.config.data;"} | |
| {"repo":"axios","file":"tests/module/cjs/tests/helpers/cjs-added-types.ts","line":92,"symbol":"invalidPromiseParams","kind":"constant","lang":"typescript","doc":"@ts-expect-error -- AxiosPromise preserves the request params type","code":"const invalidPromiseParams: { query: number } | undefined = response.config.params;"} | |
| {"repo":"axios","file":"tests/module/cjs/tests/helpers/cjs-added-types.ts","line":100,"symbol":"aliasData","kind":"constant","lang":"typescript","code":"const aliasData: SearchBody | undefined = response.config.data;"} | |
| {"repo":"axios","file":"tests/module/cjs/tests/helpers/cjs-added-types.ts","line":101,"symbol":"aliasParams","kind":"constant","lang":"typescript","code":"const aliasParams: SearchParams | undefined = response.config.params;"} | |
| {"repo":"axios","file":"tests/module/cjs/tests/helpers/cjs-added-types.ts","line":103,"symbol":"invalidAliasData","kind":"constant","lang":"typescript","doc":"@ts-expect-error -- default alias responses preserve the request data type","code":"const invalidAliasData: { includeArchived: string } | undefined = response.config.data;"} | |
| {"repo":"axios","file":"tests/module/cjs/tests/helpers/cjs-added-types.ts","line":105,"symbol":"invalidAliasParams","kind":"constant","lang":"typescript","doc":"@ts-expect-error -- default alias responses preserve the request params type","code":"const invalidAliasParams: { query: number } | undefined = response.config.params;"} | |
| {"repo":"axios","file":"tests/module/cjs/tests/helpers/cjs-added-types.ts","line":112,"symbol":"legacyParamsConfig","kind":"constant","lang":"typescript","code":"const legacyParamsConfig: axios.AxiosRequestConfig = {\n params: 'legacy values remain accepted',\n paramsSerializer: (params) => {\n const legacyParams: Record<string, any> = params;\n // @ts-expect-error -- the default serializer input remains a params record, not any\n const legacyParamsNumber: number = params;\n void legacyParamsNumber;\n return String(legacyParams.query);\n },\n};"} | |
| {"repo":"axios","file":"tests/module/cjs/tests/helpers/cjs-added-types.ts","line":115,"symbol":"legacyParams","kind":"constant","lang":"typescript","code":"const legacyParams: Record<string, any> = params;"} | |
| {"repo":"axios","file":"tests/module/cjs/tests/helpers/cjs-added-types.ts","line":117,"symbol":"legacyParamsNumber","kind":"constant","lang":"typescript","doc":"@ts-expect-error -- the default serializer input remains a params record, not any","code":"const legacyParamsNumber: number = params;"} | |
| {"repo":"axios","file":"tests/module/cjs/tests/helpers/cjs-added-types.ts","line":127,"symbol":"invalidParamsConfig","kind":"constant","lang":"typescript","code":"const invalidParamsConfig: axios.AxiosRequestConfig<unknown, SearchParams> = {\n // @ts-expect-error -- params must match the explicit request params type\n params: { query: 1 },\n};"} | |
| {"repo":"axios","file":"tests/module/cjs/tests/helpers/cjs-added-types.ts","line":137,"symbol":"mergedParamsConfig","kind":"constant","lang":"typescript","code":"const mergedParamsConfig = axios.mergeConfig<SearchBody, SearchParams>(\n rawParamsConfig,\n paramsConfig\n);"} | |
| {"repo":"axios","file":"tests/module/cjs/tests/helpers/cjs-added-types.ts","line":141,"symbol":"mergedQuery","kind":"constant","lang":"typescript","code":"const mergedQuery: string = mergedParamsConfig.params!.query;"} | |
| {"repo":"axios","file":"tests/module/cjs/tests/helpers/cjs-fetch-types.ts","line":7,"symbol":"LegacyBody","kind":"type","lang":"typescript","doc":"Existing wrappers may explicitly use the original constructor body type.","code":"type LegacyBody = ArrayBuffer | ArrayBufferView | Blob | FormData | URLSearchParams | string | null;"} | |
| {"repo":"axios","file":"tests/module/cjs/tests/helpers/cjs-fetch-types.ts","line":9,"symbol":"normalizeBody","kind":"constant","lang":"typescript","code":"const normalizeBody = (body: LegacyBody | ReadableStream<Uint8Array> | undefined) =>\n ArrayBuffer.isView(body)\n ? new Uint8Array(body.buffer, body.byteOffset, body.byteLength).slice()\n : body;"} | |
| {"repo":"axios","file":"tests/module/cjs/tests/helpers/cjs-fetch-types.ts","line":14,"symbol":"LegacyResponse","kind":"class","lang":"typescript","code":"class LegacyResponse extends Response {\n constructor(body?: LegacyBody, init?: ResponseInit) {\n super(normalizeBody(body), init);\n }\n}"} | |
| {"repo":"axios","file":"tests/module/cjs/tests/helpers/cjs-fetch-types.ts","line":15,"symbol":"constructor","kind":"method","lang":"typescript","code":"constructor(body?: LegacyBody, init?: ResponseInit) {\n super(normalizeBody(body), init);\n }"} | |
| {"repo":"axios","file":"tests/module/cjs/tests/helpers/cjs-fetch-types.ts","line":21,"symbol":"StreamCompatibleResponse","kind":"class","lang":"typescript","doc":"Supporting Axios's tracked stream must not require Node-only iterable inputs.","code":"class StreamCompatibleResponse extends Response {\n constructor(body?: LegacyBody | ReadableStream<Uint8Array>, init?: ResponseInit) {\n super(normalizeBody(body), init);\n }\n}"} | |
| {"repo":"axios","file":"tests/module/cjs/tests/helpers/cjs-fetch-types.ts","line":22,"symbol":"constructor","kind":"method","lang":"typescript","code":"constructor(body?: LegacyBody | ReadableStream<Uint8Array>, init?: ResponseInit) {\n super(normalizeBody(body), init);\n }"} | |
| {"repo":"axios","file":"tests/module/cjs/tests/helpers/cjs-fetch-types.ts","line":30,"symbol":"ResponseConstructor","kind":"type","lang":"typescript","code":"type ResponseConstructor = NonNullable<NonNullable<axios.AxiosRequestConfig['env']>['Response']>;"} | |
| {"repo":"axios","file":"tests/module/cjs/tests/helpers/cjs-fetch-types.ts","line":31,"symbol":"ResponseOverride","kind":"constant","lang":"typescript","code":"const ResponseOverride: ResponseConstructor = LegacyResponse;"} | |
| {"repo":"axios","file":"tests/module/cjs/tests/helpers/cjs-fetch-types.ts","line":45,"symbol":"constructResponse","kind":"function","lang":"typescript","doc":"Calls through the configured constructor retain the original body contract, including views typed through the general ArrayBufferView interface.","code":"function constructResponse(Response: ResponseConstructor, body: ArrayBufferView) {\n return new Response(body);\n}"} | |
| {"repo":"axios","file":"tests/module/cjs/tests/helpers/cjs-fetch-types.ts","line":54,"symbol":"StringOnlyResponse","kind":"class","lang":"typescript","code":"class StringOnlyResponse extends Response {\n constructor(body?: string | null, init?: ResponseInit) {\n super(body, init);\n }\n}"} | |
| {"repo":"axios","file":"tests/module/cjs/tests/helpers/cjs-fetch-types.ts","line":55,"symbol":"constructor","kind":"method","lang":"typescript","code":"constructor(body?: string | null, init?: ResponseInit) {\n super(body, init);\n }"} | |
| {"repo":"axios","file":"tests/module/cjs/tests/helpers/cjs-is-cancel-typing.ts","line":3,"symbol":"thrown","kind":"constant","lang":"typescript","code":"const thrown: unknown;"} | |
| {"repo":"axios","file":"tests/module/cjs/tests/helpers/cjs-is-cancel-typing.ts","line":5,"symbol":"RequestData","kind":"interface","lang":"typescript","code":"interface RequestData {\n submitted: true;\n}"} | |
| {"repo":"axios","file":"tests/module/cjs/tests/helpers/cjs-is-cancel-typing.ts","line":9,"symbol":"RequestParams","kind":"interface","lang":"typescript","code":"interface RequestParams {\n query: string;\n}"} | |
| {"repo":"axios","file":"tests/module/cjs/tests/helpers/cjs-is-cancel-typing.ts","line":14,"symbol":"canceled","kind":"constant","lang":"typescript","code":"const canceled: InstanceType<\n typeof axios.CanceledError<{ ok: true }, RequestData, RequestParams>\n > = thrown;"} | |
| {"repo":"axios","file":"tests/module/cjs/tests/helpers/cjs-is-cancel-typing.ts","line":17,"symbol":"data","kind":"constant","lang":"typescript","code":"const data: { ok: true } | undefined = thrown.response?.data;"} | |
| {"repo":"axios","file":"tests/module/cjs/tests/helpers/cjs-is-cancel-typing.ts","line":18,"symbol":"requestData","kind":"constant","lang":"typescript","code":"const requestData: RequestData | undefined = thrown.config?.data;"} | |
| {"repo":"axios","file":"tests/module/cjs/tests/helpers/cjs-is-cancel-typing.ts","line":19,"symbol":"params","kind":"constant","lang":"typescript","code":"const params: RequestParams | undefined = thrown.config?.params;"} | |
| {"repo":"axios","file":"tests/module/cjs/tests/helpers/cjs-is-cancel-typing.ts","line":21,"symbol":"wrongData","kind":"constant","lang":"typescript","doc":"@ts-expect-error -- The generic response data must not be widened to any.","code":"const wrongData: { ok: false } | undefined = thrown.response?.data;"} | |
| {"repo":"axios","file":"tests/module/cjs/tests/helpers/cjs-is-cancel-typing.ts","line":23,"symbol":"wrongRequestData","kind":"constant","lang":"typescript","doc":"@ts-expect-error -- The generic request data must not be widened to any.","code":"const wrongRequestData: { submitted: false } | undefined = thrown.config?.data;"} | |
| {"repo":"axios","file":"tests/module/cjs/tests/helpers/cjs-is-cancel-typing.ts","line":25,"symbol":"wrongParams","kind":"constant","lang":"typescript","doc":"@ts-expect-error -- The generic request params must not be widened to any.","code":"const wrongParams: { query: number } | undefined = thrown.config?.params;"} | |
| {"repo":"axios","file":"tests/module/cjs/tests/helpers/cjs-typing.ts","line":4,"symbol":"config","kind":"constant","lang":"typescript","code":"const config: axios.AxiosRequestConfig = {\n url: '/user',\n method: 'get',\n allowAbsoluteUrls: false,\n baseURL: 'https://api.example.com/',\n transformRequest: (data: any) => '{\"foo\":\"bar\"}',\n transformResponse: [(data: any) => ({ baz: 'qux' })],\n headers: { 'X-FOO': 'bar' },\n params: { id: 12345 },\n paramsSerializer: {\n indexes: true,\n encode: (value: any) => value,\n serialize: (value: Record<string, any>, options?: axios.ParamsSerializerOptions) =>\n String(value),\n },\n data: { foo: 'bar' },\n timeout: 10000,\n withCredentials: true,\n auth: {\n username: 'janedoe',\n password: 's00pers3cret',\n },\n responseType: 'json',\n xsrfCookieName: 'XSRF-TOKEN',\n xsrfHeaderName: 'X-XSRF-TOKEN',\n onUploadProgress: (progressEvent: axios.AxiosProgressEvent) => {},\n onDownloadProgress: (progressEvent: axios.AxiosProgressEvent) => {},\n maxContentLength: 2000,\n maxBodyLength: 2000,\n validateStatus: (status: number) => status >= 200 && status < 300,\n maxRedirects: 5,\n proxy: {\n host: '127.0.0.1',\n port: 9000,\n },\n cancelToken: new axios.CancelToken((cancel: axios.Canceler) => {}),\n};"} | |
| {"repo":"axios","file":"tests/module/cjs/tests/helpers/cjs-typing.ts","line":42,"symbol":"nullValidateStatusConfig","kind":"constant","lang":"typescript","code":"const nullValidateStatusConfig: axios.AxiosRequestConfig = {\n validateStatus: null,\n};"} | |
| {"repo":"axios","file":"tests/module/cjs/tests/helpers/cjs-typing.ts","line":46,"symbol":"undefinedValidateStatusConfig","kind":"constant","lang":"typescript","code":"const undefinedValidateStatusConfig: axios.AxiosRequestConfig = {\n validateStatus: undefined,\n};"} | |
| {"repo":"axios","file":"tests/module/cjs/tests/helpers/cjs-typing.ts","line":50,"symbol":"handleResponse","kind":"constant","lang":"typescript","code":"const handleResponse = (response: axios.AxiosResponse) => {\n console.log(response.data);\n console.log(response.status);\n console.log(response.statusText);\n console.log(response.headers);\n console.log(response.config);\n};"} | |
| {"repo":"axios","file":"tests/module/cjs/tests/helpers/cjs-typing.ts","line":58,"symbol":"handleError","kind":"constant","lang":"typescript","code":"const handleError = (error: axios.AxiosError) => {\n if (error.response) {\n console.log(error.response.data);\n console.log(error.response.status);\n console.log(error.response.headers);\n } else {\n console.log(error.message);\n }\n};"} | |
| {"repo":"axios","file":"tests/module/cjs/tests/helpers/cjs-typing.ts","line":97,"symbol":"UserCreationDef","kind":"interface","lang":"typescript","doc":"Typed methods","code":"interface UserCreationDef {\n name: string;\n}"} | |
| {"repo":"axios","file":"tests/module/cjs/tests/helpers/cjs-typing.ts","line":101,"symbol":"User","kind":"interface","lang":"typescript","code":"interface User {\n id: number;\n name: string;\n}"} | |
| {"repo":"axios","file":"tests/module/cjs/tests/helpers/cjs-typing.ts","line":106,"symbol":"ResponseHeaders","kind":"interface","lang":"typescript","code":"interface ResponseHeaders {\n 'x-header': string;\n}"} | |
| {"repo":"axios","file":"tests/module/cjs/tests/helpers/cjs-typing.ts","line":112,"symbol":"handleUserResponse","kind":"constant","lang":"typescript","code":"const handleUserResponse = (response: axios.AxiosResponse<User>) => {\n console.log(response.data.id);\n console.log(response.data.name);\n console.log(response.status);\n console.log(response.statusText);\n console.log(response.headers);\n console.log(response.config);\n};"} | |
| {"repo":"axios","file":"tests/module/cjs/tests/helpers/cjs-typing.ts","line":147,"symbol":"handleUserResponseWithCustomHeaders","kind":"constant","lang":"typescript","code":"const handleUserResponseWithCustomHeaders = (\n response: axios.AxiosResponse<User, any, ResponseHeaders>\n) => {\n console.log(response.data.id);\n console.log(response.data.name);\n console.log(response.status);\n console.log(response.statusText);\n console.log(response.headers);\n console.log(response.config);\n};"} | |
| {"repo":"axios","file":"tests/module/cjs/tests/helpers/cjs-typing.ts","line":209,"symbol":"handleStringResponse","kind":"constant","lang":"typescript","code":"const handleStringResponse = (response: string) => {\n console.log(response);\n};"} | |
| {"repo":"axios","file":"tests/module/cjs/tests/helpers/cjs-typing.ts","line":256,"symbol":"instance1","kind":"constant","lang":"typescript","code":"const instance1: axios.AxiosInstance = axios.create();"} | |
| {"repo":"axios","file":"tests/module/cjs/tests/helpers/cjs-typing.ts","line":257,"symbol":"instance2","kind":"constant","lang":"typescript","code":"const instance2: axios.AxiosInstance = axios.create(config);"} | |
| {"repo":"axios","file":"tests/module/cjs/tests/helpers/cjs-typing.ts","line":311,"symbol":"requestInterceptorId","kind":"constant","lang":"typescript","code":"const requestInterceptorId: number = axios.interceptors.request.use(\n (config: axios.InternalAxiosRequestConfig) => config,\n (error: any) => Promise.reject(error)\n);"} | |
| {"repo":"axios","file":"tests/module/cjs/tests/helpers/cjs-typing.ts","line":328,"symbol":"responseInterceptorId","kind":"constant","lang":"typescript","code":"const responseInterceptorId: number = axios.interceptors.response.use(\n (response: axios.AxiosResponse) => response,\n (error: any) => Promise.reject(error)\n);"} | |
| {"repo":"axios","file":"tests/module/cjs/tests/helpers/cjs-typing.ts","line":347,"symbol":"voidRequestInterceptorId","kind":"constant","lang":"typescript","code":"const voidRequestInterceptorId = axios.interceptors.request.use(\n // @ts-expect-error -- Must return an axios.AxiosRequestConfig (or throw)\n (_response) => {},\n (error: any) => Promise.reject(error)\n);"} | |
| {"repo":"axios","file":"tests/module/cjs/tests/helpers/cjs-typing.ts","line":352,"symbol":"voidResponseInterceptorId","kind":"constant","lang":"typescript","code":"const voidResponseInterceptorId = axios.interceptors.response.use(\n // @ts-expect-error -- Must return an axios.AxiosResponse (or throw)\n (_response) => {},\n (error: any) => Promise.reject(error)\n);"} | |
| {"repo":"axios","file":"tests/module/cjs/tests/helpers/cjs-typing.ts","line":368,"symbol":"adapter","kind":"constant","lang":"typescript","code":"const adapter: axios.AxiosAdapter = (config: axios.InternalAxiosRequestConfig) => {\n const response: axios.AxiosResponse = {\n data: { foo: 'bar' },\n status: 200,\n statusText: 'OK',\n headers: { 'X-FOO': 'bar' },\n config,\n };\n return Promise.resolve(response);\n};"} | |
| {"repo":"axios","file":"tests/module/cjs/tests/helpers/cjs-typing.ts","line":369,"symbol":"response","kind":"constant","lang":"typescript","code":"const response: axios.AxiosResponse = {\n data: { foo: 'bar' },\n status: 200,\n statusText: 'OK',\n headers: { 'X-FOO': 'bar' },\n config,\n };"} | |
| {"repo":"axios","file":"tests/module/cjs/tests/helpers/cjs-typing.ts","line":383,"symbol":"promises","kind":"constant","lang":"typescript","code":"const promises = [Promise.resolve(1), Promise.resolve(2)];"} | |
| {"repo":"axios","file":"tests/module/cjs/tests/helpers/cjs-typing.ts","line":385,"symbol":"promise","kind":"constant","lang":"typescript","code":"const promise: Promise<number[]> = axios.all(promises);"} | |
| {"repo":"axios","file":"tests/module/cjs/tests/helpers/cjs-typing.ts","line":389,"symbol":"fn1","kind":"constant","lang":"typescript","code":"const fn1 = (a: number, b: number, c: number) => `${a}-${b}-${c}`;"} | |
| {"repo":"axios","file":"tests/module/cjs/tests/helpers/cjs-typing.ts","line":390,"symbol":"fn2","kind":"constant","lang":"typescript","code":"const fn2: (arr: number[]) => string = axios.spread(fn1);"} | |
| {"repo":"axios","file":"tests/module/cjs/tests/helpers/cjs-typing.ts","line":432,"symbol":"source","kind":"constant","lang":"typescript","code":"const source: axios.CancelTokenSource = axios.CancelToken.source();"} | |
| {"repo":"axios","file":"tests/module/cjs/tests/helpers/cjs-typing.ts","line":440,"symbol":"cancel","kind":"constant","lang":"typescript","code":"const cancel: axios.Cancel = thrown;"} | |
| {"repo":"axios","file":"tests/module/cjs/tests/helpers/cjs-typing.ts","line":451,"symbol":"axiosError","kind":"constant","lang":"typescript","code":"const axiosError: axios.AxiosError = error;"} | |
| {"repo":"axios","file":"tests/module/cjs/tests/helpers/cjs-typing.ts","line":502,"symbol":"headers","kind":"constant","lang":"typescript","code":"const headers = new axios.AxiosHeaders({ foo: 'bar' });"} | |
| {"repo":"axios","file":"tests/module/cjs/tests/helpers/cjs-typing.ts","line":511,"symbol":"headers","kind":"constant","lang":"typescript","code":"const headers = new axios.AxiosHeaders({ x: 1 });"} | |
| {"repo":"axios","file":"tests/module/cjs/tests/helpers/cjs-typing.ts","line":519,"symbol":"headers","kind":"constant","lang":"typescript","code":"const headers: axios.AxiosRequestHeaders = new axios.AxiosHeaders({ x: 1 });"} | |
| {"repo":"axios","file":"tests/module/cjs/tests/helpers/cjs-typing.ts","line":529,"symbol":"requestInterceptorId","kind":"constant","lang":"typescript","code":"const requestInterceptorId: number = axios.interceptors.request.use(\n async (config) => {\n config.headers.Accept = 'foo';\n config.headers.setAccept('foo');\n config.headers = new axios.AxiosHeaders({ x: 1 });\n config.headers.foo = '1';\n config.headers.set('bar', '2');\n config.headers.set({ myHeader: 'myValue' });\n config.headers = new axios.AxiosHeaders({ myHeader: 'myValue' });\n config.headers = { ...config.headers } as axios.AxiosRequestHeaders;\n return config;\n },\n (error: any) => Promise.reject(error)\n );"} | |
| {"repo":"axios","file":"tests/module/cjs/tests/helpers/cjs-typing.ts","line":546,"symbol":"config","kind":"constant","lang":"typescript","code":"const config: axios.AxiosRequestConfig = { headers: new axios.AxiosHeaders({ foo: 1 }) };"} | |
| {"repo":"axios","file":"tests/module/cjs/tests/helpers/ts-require-default.ts","line":2,"symbol":"assert","kind":"constant","lang":"typescript","doc":"@ts-nocheck","code":"const assert = require('assert');"} | |
| {"repo":"axios","file":"tests/module/cjs/tests/helpers/ts-require-default.ts","line":3,"symbol":"axios","kind":"constant","lang":"typescript","code":"const axios = require('axios').default;"} | |
| {"repo":"axios","file":"tests/module/cjs/tests/helpers/ts-require.ts","line":2,"symbol":"assert","kind":"constant","lang":"typescript","doc":"@ts-nocheck","code":"const assert = require('assert');"} | |
| {"repo":"axios","file":"tests/module/cjs/tests/helpers/ts-require.ts","line":3,"symbol":"axios","kind":"constant","lang":"typescript","code":"const axios = require('axios');"} | |
| {"repo":"axios","file":"tests/module/esm/tests/helpers/declaration-consumer.ts","line":4,"symbol":"User","kind":"interface","lang":"typescript","code":"interface User {\n id: number;\n name: string;\n}"} | |
| {"repo":"axios","file":"tests/module/esm/tests/helpers/declaration-consumer.ts","line":9,"symbol":"CustomResponse","kind":"interface","lang":"typescript","code":"interface CustomResponse {\n user: User;\n fromCache: boolean;\n}"} | |
| {"repo":"axios","file":"tests/module/esm/tests/helpers/declaration-consumer.ts","line":14,"symbol":"client","kind":"constant","lang":"typescript","code":"const client: AxiosInstance;"} | |
| {"repo":"axios","file":"tests/module/esm/tests/helpers/declaration-consumer.ts","line":17,"symbol":"request","kind":"constant","lang":"typescript","code":"const request = makeRequest(client);"} | |
| {"repo":"axios","file":"tests/module/esm/tests/helpers/declaration-consumer.ts","line":20,"symbol":"defaultResponse","kind":"constant","lang":"typescript","code":"const defaultResponse = request<User>();"} | |
| {"repo":"axios","file":"tests/module/esm/tests/helpers/declaration-consumer.ts","line":25,"symbol":"customResponse","kind":"constant","lang":"typescript","code":"const customResponse = request<User, CustomResponse>();"} | |
| {"repo":"axios","file":"tests/module/esm/tests/helpers/declaration-emit.ts","line":3,"symbol":"makeRequest","kind":"constant","lang":"typescript","code":"const makeRequest = function (client: AxiosInstance) {\n return <T = unknown, R = AxiosResponse<T>>() =>\n client.request<T, R>({ url: '/' });\n};"} | |
| {"repo":"axios","file":"tests/module/esm/tests/helpers/esm-added-types.ts","line":19,"symbol":"headers","kind":"constant","lang":"typescript","code":"const headers = new AxiosHeaders();"} | |
| {"repo":"axios","file":"tests/module/esm/tests/helpers/esm-added-types.ts","line":20,"symbol":"iterableHeaders","kind":"constant","lang":"typescript","code":"const iterableHeaders: Iterable<[string, AxiosHeaderValue]> = [['x-test', 'ok']];"} | |
| {"repo":"axios","file":"tests/module/esm/tests/helpers/esm-added-types.ts","line":22,"symbol":"serializedHeaders","kind":"constant","lang":"typescript","code":"const serializedHeaders: string = headers.toString();"} | |
| {"repo":"axios","file":"tests/module/esm/tests/helpers/esm-added-types.ts","line":23,"symbol":"parsedParameters","kind":"constant","lang":"typescript","code":"const parsedParameters: AxiosHeaderParameters = AxiosHeaders.parseParameters(\n 'multipart/form-data; boundary=\"test\"'\n);"} | |
| {"repo":"axios","file":"tests/module/esm/tests/helpers/esm-added-types.ts","line":27,"symbol":"parsedHeaderParameters","kind":"constant","lang":"typescript","code":"const parsedHeaderParameters: AxiosHeaderParameters = headers.get(\n 'content-type',\n AxiosHeaders.parseParameters\n);"} | |
| {"repo":"axios","file":"tests/module/esm/tests/helpers/esm-added-types.ts","line":32,"symbol":"source","kind":"constant","lang":"typescript","code":"const source = axios.CancelToken.source();"} | |
| {"repo":"axios","file":"tests/module/esm/tests/helpers/esm-added-types.ts","line":34,"symbol":"message","kind":"constant","lang":"typescript","code":"const message: string | undefined = cancel && cancel.message;"} | |
| {"repo":"axios","file":"tests/module/esm/tests/helpers/esm-added-types.ts","line":38,"symbol":"signal","kind":"constant","lang":"typescript","code":"const signal: AbortSignal = source.token.toAbortSignal();"} | |
| {"repo":"axios","file":"tests/module/esm/tests/helpers/esm-added-types.ts","line":40,"symbol":"cancel","kind":"constant","lang":"typescript","code":"const cancel = new CanceledError<{ ok: true }>(\n 'stop',\n {} as InternalAxiosRequestConfig,\n {}\n);"} | |
| {"repo":"axios","file":"tests/module/esm/tests/helpers/esm-added-types.ts","line":45,"symbol":"cancelFlag","kind":"constant","lang":"typescript","code":"const cancelFlag: boolean | undefined = cancel.__CANCEL__;"} | |
| {"repo":"axios","file":"tests/module/esm/tests/helpers/esm-added-types.ts","line":46,"symbol":"cancelCtor","kind":"constant","lang":"typescript","code":"const cancelCtor: typeof CanceledError = axios.Cancel;"} | |
| {"repo":"axios","file":"tests/module/esm/tests/helpers/esm-added-types.ts","line":47,"symbol":"cancelFromAlias","kind":"constant","lang":"typescript","code":"const cancelFromAlias = new cancelCtor('from alias');"} | |
| {"repo":"axios","file":"tests/module/esm/tests/helpers/esm-added-types.ts","line":49,"symbol":"status","kind":"constant","lang":"typescript","code":"const status: HttpStatusCode = HttpStatusCode.WebServerIsDown;"} | |
| {"repo":"axios","file":"tests/module/esm/tests/helpers/esm-added-types.ts","line":50,"symbol":"unknownErrorStatus","kind":"constant","lang":"typescript","code":"const unknownErrorStatus: HttpStatusCode = HttpStatusCode.WebServerReturnsAnUnknownError;"} | |
| {"repo":"axios","file":"tests/module/esm/tests/helpers/esm-added-types.ts","line":51,"symbol":"contentTooLargeStatus","kind":"constant","lang":"typescript","code":"const contentTooLargeStatus: HttpStatusCode = HttpStatusCode.ContentTooLarge;"} | |
| {"repo":"axios","file":"tests/module/esm/tests/helpers/esm-added-types.ts","line":52,"symbol":"unprocessableContentStatus","kind":"constant","lang":"typescript","code":"const unprocessableContentStatus: HttpStatusCode = HttpStatusCode.UnprocessableContent;"} | |
| {"repo":"axios","file":"tests/module/esm/tests/helpers/esm-added-types.ts","line":54,"symbol":"CustomBlob","kind":"class","lang":"typescript","code":"class CustomBlob {\n constructor(_parts?: any[]) {}\n}"} | |
| {"repo":"axios","file":"tests/module/esm/tests/helpers/esm-added-types.ts","line":55,"symbol":"constructor","kind":"method","lang":"typescript","code":"constructor(_parts?: any[]) {}"} | |
| {"repo":"axios","file":"tests/module/esm/tests/helpers/esm-added-types.ts","line":58,"symbol":"serializerOptions","kind":"constant","lang":"typescript","code":"const serializerOptions: FormSerializerOptions = {\n maxDepth: 2,\n Blob: CustomBlob,\n};"} | |
| {"repo":"axios","file":"tests/module/esm/tests/helpers/esm-added-types.ts","line":65,"symbol":"SearchBody","kind":"interface","lang":"typescript","code":"interface SearchBody {\n includeArchived: boolean;\n}"} | |
| {"repo":"axios","file":"tests/module/esm/tests/helpers/esm-added-types.ts","line":69,"symbol":"SearchParams","kind":"interface","lang":"typescript","code":"interface SearchParams {\n query: string;\n page?: number;\n}"} | |
| {"repo":"axios","file":"tests/module/esm/tests/helpers/esm-added-types.ts","line":74,"symbol":"paramsConfig","kind":"constant","lang":"typescript","code":"const paramsConfig: AxiosRequestConfig<SearchBody, SearchParams> = {\n data: { includeArchived: false },\n params: { query: 'axios', page: 1 },\n paramsSerializer: (params) => {\n const query: string = params.query;\n const page: number | undefined = params.page;\n // @ts-expect-error -- serializer params use the request params type\n const invalidQuery: number = params.query;\n void invalidQuery;\n return `${query}:${page ?? 1}`;\n },\n withXSRFToken: (config) => config.params?.query === 'axios',\n};"} | |
| {"repo":"axios","file":"tests/module/esm/tests/helpers/esm-added-types.ts","line":78,"symbol":"query","kind":"constant","lang":"typescript","code":"const query: string = params.query;"} | |
| {"repo":"axios","file":"tests/module/esm/tests/helpers/esm-added-types.ts","line":79,"symbol":"page","kind":"constant","lang":"typescript","code":"const page: number | undefined = params.page;"} | |
| {"repo":"axios","file":"tests/module/esm/tests/helpers/esm-added-types.ts","line":81,"symbol":"invalidQuery","kind":"constant","lang":"typescript","doc":"@ts-expect-error -- serializer params use the request params type","code":"const invalidQuery: number = params.query;"} | |
| {"repo":"axios","file":"tests/module/esm/tests/helpers/esm-added-types.ts","line":88,"symbol":"customParamsSerializer","kind":"constant","lang":"typescript","code":"const customParamsSerializer: CustomParamsSerializer<SearchParams> = (params) => params.query;"} | |
| {"repo":"axios","file":"tests/module/esm/tests/helpers/esm-added-types.ts","line":89,"symbol":"rawParamsConfig","kind":"constant","lang":"typescript","code":"const rawParamsConfig: RawAxiosRequestConfig<SearchBody, SearchParams> = paramsConfig;"} | |
| {"repo":"axios","file":"tests/module/esm/tests/helpers/esm-added-types.ts","line":90,"symbol":"internalParamsConfig","kind":"constant","lang":"typescript","code":"const internalParamsConfig = {\n ...paramsConfig,\n headers: new AxiosHeaders(),\n} as InternalAxiosRequestConfig<SearchBody, SearchParams>;"} | |
| {"repo":"axios","file":"tests/module/esm/tests/helpers/esm-added-types.ts","line":94,"symbol":"paramsResponse","kind":"constant","lang":"typescript","code":"const paramsResponse = {} as AxiosResponse<unknown, SearchBody, {}, SearchParams>;"} | |
| {"repo":"axios","file":"tests/module/esm/tests/helpers/esm-added-types.ts","line":95,"symbol":"paramsError","kind":"constant","lang":"typescript","code":"const paramsError = {} as AxiosError<unknown, SearchBody, SearchParams>;"} | |
| {"repo":"axios","file":"tests/module/esm/tests/helpers/esm-added-types.ts","line":96,"symbol":"paramsPromise","kind":"constant","lang":"typescript","code":"const paramsPromise: AxiosPromise<unknown, SearchBody, SearchParams>;"} | |
| {"repo":"axios","file":"tests/module/esm/tests/helpers/esm-added-types.ts","line":98,"symbol":"internalQuery","kind":"constant","lang":"typescript","code":"const internalQuery: string = internalParamsConfig.params!.query;"} | |
| {"repo":"axios","file":"tests/module/esm/tests/helpers/esm-added-types.ts","line":99,"symbol":"responseQuery","kind":"constant","lang":"typescript","code":"const responseQuery: string = paramsResponse.config.params!.query;"} | |
| {"repo":"axios","file":"tests/module/esm/tests/helpers/esm-added-types.ts","line":100,"symbol":"errorQuery","kind":"constant","lang":"typescript","code":"const errorQuery: string = paramsError.config!.params!.query;"} | |
| {"repo":"axios","file":"tests/module/esm/tests/helpers/esm-added-types.ts","line":103,"symbol":"promiseData","kind":"constant","lang":"typescript","code":"const promiseData: SearchBody | undefined = response.config.data;"} | |
| {"repo":"axios","file":"tests/module/esm/tests/helpers/esm-added-types.ts","line":104,"symbol":"promiseParams","kind":"constant","lang":"typescript","code":"const promiseParams: SearchParams | undefined = response.config.params;"} | |
| {"repo":"axios","file":"tests/module/esm/tests/helpers/esm-added-types.ts","line":106,"symbol":"invalidPromiseData","kind":"constant","lang":"typescript","doc":"@ts-expect-error -- AxiosPromise preserves the request data type","code":"const invalidPromiseData: { includeArchived: string } | undefined = response.config.data;"} | |
| {"repo":"axios","file":"tests/module/esm/tests/helpers/esm-added-types.ts","line":108,"symbol":"invalidPromiseParams","kind":"constant","lang":"typescript","doc":"@ts-expect-error -- AxiosPromise preserves the request params type","code":"const invalidPromiseParams: { query: number } | undefined = response.config.params;"} | |
| {"repo":"axios","file":"tests/module/esm/tests/helpers/esm-added-types.ts","line":116,"symbol":"aliasData","kind":"constant","lang":"typescript","code":"const aliasData: SearchBody | undefined = response.config.data;"} | |
| {"repo":"axios","file":"tests/module/esm/tests/helpers/esm-added-types.ts","line":117,"symbol":"aliasParams","kind":"constant","lang":"typescript","code":"const aliasParams: SearchParams | undefined = response.config.params;"} | |
| {"repo":"axios","file":"tests/module/esm/tests/helpers/esm-added-types.ts","line":119,"symbol":"invalidAliasData","kind":"constant","lang":"typescript","doc":"@ts-expect-error -- default alias responses preserve the request data type","code":"const invalidAliasData: { includeArchived: string } | undefined = response.config.data;"} | |
| {"repo":"axios","file":"tests/module/esm/tests/helpers/esm-added-types.ts","line":121,"symbol":"invalidAliasParams","kind":"constant","lang":"typescript","doc":"@ts-expect-error -- default alias responses preserve the request params type","code":"const invalidAliasParams: { query: number } | undefined = response.config.params;"} | |
| {"repo":"axios","file":"tests/module/esm/tests/helpers/esm-added-types.ts","line":128,"symbol":"thrown","kind":"constant","lang":"typescript","code":"const thrown: unknown;"} | |
| {"repo":"axios","file":"tests/module/esm/tests/helpers/esm-added-types.ts","line":131,"symbol":"canceledData","kind":"constant","lang":"typescript","code":"const canceledData: SearchBody | undefined = thrown.config?.data;"} | |
| {"repo":"axios","file":"tests/module/esm/tests/helpers/esm-added-types.ts","line":132,"symbol":"canceledParams","kind":"constant","lang":"typescript","code":"const canceledParams: SearchParams | undefined = thrown.config?.params;"} | |
| {"repo":"axios","file":"tests/module/esm/tests/helpers/esm-added-types.ts","line":134,"symbol":"invalidCanceledData","kind":"constant","lang":"typescript","doc":"@ts-expect-error -- canceled request data must not be widened to any","code":"const invalidCanceledData: { includeArchived: string } | undefined = thrown.config?.data;"} | |
| {"repo":"axios","file":"tests/module/esm/tests/helpers/esm-added-types.ts","line":136,"symbol":"invalidCanceledParams","kind":"constant","lang":"typescript","doc":"@ts-expect-error -- canceled request params must not be widened to any","code":"const invalidCanceledParams: { query: number } | undefined = thrown.config?.params;"} | |
| {"repo":"axios","file":"tests/module/esm/tests/helpers/esm-added-types.ts","line":143,"symbol":"legacyParamsConfig","kind":"constant","lang":"typescript","code":"const legacyParamsConfig: AxiosRequestConfig = {\n params: 'legacy values remain accepted',\n paramsSerializer: (params) => {\n const legacyParams: Record<string, any> = params;\n // @ts-expect-error -- the default serializer input remains a params record, not any\n const legacyParamsNumber: number = params;\n void legacyParamsNumber;\n return String(legacyParams.query);\n },\n};"} | |
| {"repo":"axios","file":"tests/module/esm/tests/helpers/esm-added-types.ts","line":146,"symbol":"legacyParams","kind":"constant","lang":"typescript","code":"const legacyParams: Record<string, any> = params;"} | |
| {"repo":"axios","file":"tests/module/esm/tests/helpers/esm-added-types.ts","line":148,"symbol":"legacyParamsNumber","kind":"constant","lang":"typescript","doc":"@ts-expect-error -- the default serializer input remains a params record, not any","code":"const legacyParamsNumber: number = params;"} | |
| {"repo":"axios","file":"tests/module/esm/tests/helpers/esm-added-types.ts","line":158,"symbol":"invalidParamsConfig","kind":"constant","lang":"typescript","code":"const invalidParamsConfig: AxiosRequestConfig<unknown, SearchParams> = {\n // @ts-expect-error -- params must match the explicit request params type\n params: { query: 1 },\n};"} | |
| {"repo":"axios","file":"tests/module/esm/tests/helpers/esm-added-types.ts","line":168,"symbol":"mergedParamsConfig","kind":"constant","lang":"typescript","code":"const mergedParamsConfig = axios.mergeConfig<SearchBody, SearchParams>(\n rawParamsConfig,\n paramsConfig\n);"} | |
| {"repo":"axios","file":"tests/module/esm/tests/helpers/esm-added-types.ts","line":172,"symbol":"mergedQuery","kind":"constant","lang":"typescript","code":"const mergedQuery: string = mergedParamsConfig.params!.query;"} | |
| {"repo":"axios","file":"tests/module/esm/tests/helpers/esm-fetch-types.ts","line":7,"symbol":"LegacyBody","kind":"type","lang":"typescript","doc":"Existing wrappers may explicitly use the original constructor body type.","code":"type LegacyBody = ArrayBuffer | ArrayBufferView | Blob | FormData | URLSearchParams | string | null;"} | |
| {"repo":"axios","file":"tests/module/esm/tests/helpers/esm-fetch-types.ts","line":9,"symbol":"normalizeBody","kind":"constant","lang":"typescript","code":"const normalizeBody = (body: LegacyBody | ReadableStream<Uint8Array> | undefined) =>\n ArrayBuffer.isView(body)\n ? new Uint8Array(body.buffer, body.byteOffset, body.byteLength).slice()\n : body;"} | |
| {"repo":"axios","file":"tests/module/esm/tests/helpers/esm-fetch-types.ts","line":14,"symbol":"LegacyResponse","kind":"class","lang":"typescript","code":"class LegacyResponse extends Response {\n constructor(body?: LegacyBody, init?: ResponseInit) {\n super(normalizeBody(body), init);\n }\n}"} | |
| {"repo":"axios","file":"tests/module/esm/tests/helpers/esm-fetch-types.ts","line":15,"symbol":"constructor","kind":"method","lang":"typescript","code":"constructor(body?: LegacyBody, init?: ResponseInit) {\n super(normalizeBody(body), init);\n }"} | |
| {"repo":"axios","file":"tests/module/esm/tests/helpers/esm-fetch-types.ts","line":21,"symbol":"StreamCompatibleResponse","kind":"class","lang":"typescript","doc":"Supporting Axios's tracked stream must not require Node-only iterable inputs.","code":"class StreamCompatibleResponse extends Response {\n constructor(body?: LegacyBody | ReadableStream<Uint8Array>, init?: ResponseInit) {\n super(normalizeBody(body), init);\n }\n}"} | |
| {"repo":"axios","file":"tests/module/esm/tests/helpers/esm-fetch-types.ts","line":22,"symbol":"constructor","kind":"method","lang":"typescript","code":"constructor(body?: LegacyBody | ReadableStream<Uint8Array>, init?: ResponseInit) {\n super(normalizeBody(body), init);\n }"} | |
| {"repo":"axios","file":"tests/module/esm/tests/helpers/esm-fetch-types.ts","line":30,"symbol":"ResponseConstructor","kind":"type","lang":"typescript","code":"type ResponseConstructor = NonNullable<NonNullable<AxiosRequestConfig['env']>['Response']>;"} | |
| {"repo":"axios","file":"tests/module/esm/tests/helpers/esm-fetch-types.ts","line":31,"symbol":"ResponseOverride","kind":"constant","lang":"typescript","code":"const ResponseOverride: ResponseConstructor = LegacyResponse;"} | |
| {"repo":"axios","file":"tests/module/esm/tests/helpers/esm-fetch-types.ts","line":45,"symbol":"constructResponse","kind":"function","lang":"typescript","doc":"Calls through the configured constructor retain the original body contract, including views typed through the general ArrayBufferView interface.","code":"function constructResponse(Response: ResponseConstructor, body: ArrayBufferView) {\n return new Response(body);\n}"} | |
| {"repo":"axios","file":"tests/module/esm/tests/helpers/esm-fetch-types.ts","line":54,"symbol":"StringOnlyResponse","kind":"class","lang":"typescript","code":"class StringOnlyResponse extends Response {\n constructor(body?: string | null, init?: ResponseInit) {\n super(body, init);\n }\n}"} | |
| {"repo":"axios","file":"tests/module/esm/tests/helpers/esm-fetch-types.ts","line":55,"symbol":"constructor","kind":"method","lang":"typescript","code":"constructor(body?: string | null, init?: ResponseInit) {\n super(body, init);\n }"} | |
| {"repo":"axios","file":"tests/module/esm/tests/helpers/esm-index.ts","line":27,"symbol":"config","kind":"constant","lang":"typescript","code":"const config: AxiosRequestConfig = {\n url: '/user',\n method: 'get',\n baseURL: 'https://api.example.com/',\n allowAbsoluteUrls: false,\n transformRequest: (data: any) => '{\"foo\":\"bar\"}',\n transformResponse: [(data: any) => ({ baz: 'qux' })],\n headers: { 'X-FOO': 'bar' },\n params: { id: 12345 },\n paramsSerializer: {\n indexes: true,\n encode: (value: any) => value,\n serialize: (value: Record<string, any>, options?: ParamsSerializerOptions) => String(value),\n },\n data: { foo: 'bar' },\n timeout: 10000,\n withCredentials: true,\n auth: {\n username: 'janedoe',\n password: 's00pers3cret',\n },\n responseType: 'json',\n xsrfCookieName: 'XSRF-TOKEN',\n xsrfHeaderName: 'X-XSRF-TOKEN',\n onUploadProgress: (progressEvent: AxiosProgressEvent) => {},\n onDownloadProgress: (progressEvent: AxiosProgressEvent) => {},\n maxContentLength: 2000,\n maxBodyLength: 2000,\n validateStatus: (status: number) => status >= 200 && status < 300,\n maxRedirects: 5,\n proxy: {\n host: '127.0.0.1',\n port: 9000,\n },\n cancelToken: new axios.CancelToken((cancel: Canceler) => {}),\n};"} | |
| {"repo":"axios","file":"tests/module/esm/tests/helpers/esm-index.ts","line":64,"symbol":"nullValidateStatusConfig","kind":"constant","lang":"typescript","code":"const nullValidateStatusConfig: AxiosRequestConfig = {\n validateStatus: null,\n};"} | |
| {"repo":"axios","file":"tests/module/esm/tests/helpers/esm-index.ts","line":68,"symbol":"undefinedValidateStatusConfig","kind":"constant","lang":"typescript","code":"const undefinedValidateStatusConfig: AxiosRequestConfig = {\n validateStatus: undefined,\n};"} | |
| {"repo":"axios","file":"tests/module/esm/tests/helpers/esm-index.ts","line":72,"symbol":"handleResponse","kind":"constant","lang":"typescript","code":"const handleResponse = (response: AxiosResponse) => {\n console.log(response.data);\n console.log(response.status);\n console.log(response.statusText);\n console.log(response.headers);\n console.log(response.config);\n};"} | |
| {"repo":"axios","file":"tests/module/esm/tests/helpers/esm-index.ts","line":80,"symbol":"handleError","kind":"constant","lang":"typescript","code":"const handleError = (error: AxiosError) => {\n if (error.response) {\n console.log(error.response.data);\n console.log(error.response.status);\n console.log(error.response.headers);\n } else {\n console.log(error.message);\n }\n};"} | |
| {"repo":"axios","file":"tests/module/esm/tests/helpers/esm-index.ts","line":119,"symbol":"UserCreationDef","kind":"interface","lang":"typescript","doc":"Typed methods","code":"interface UserCreationDef {\n name: string;\n}"} | |
| {"repo":"axios","file":"tests/module/esm/tests/helpers/esm-index.ts","line":123,"symbol":"User","kind":"interface","lang":"typescript","code":"interface User {\n id: number;\n name: string;\n}"} | |
| {"repo":"axios","file":"tests/module/esm/tests/helpers/esm-index.ts","line":128,"symbol":"ResponseHeaders","kind":"interface","lang":"typescript","code":"interface ResponseHeaders {\n 'x-header': string;\n}"} | |
| {"repo":"axios","file":"tests/module/esm/tests/helpers/esm-index.ts","line":134,"symbol":"handleUserResponse","kind":"constant","lang":"typescript","code":"const handleUserResponse = (response: AxiosResponse<User>) => {\n console.log(response.data.id);\n console.log(response.data.name);\n console.log(response.status);\n console.log(response.statusText);\n console.log(response.headers);\n console.log(response.config);\n};"} | |
| {"repo":"axios","file":"tests/module/esm/tests/helpers/esm-index.ts","line":169,"symbol":"handleUserResponseWithCustomHeaders","kind":"constant","lang":"typescript","code":"const handleUserResponseWithCustomHeaders = (\n response: AxiosResponse<User, any, ResponseHeaders>\n) => {\n console.log(response.data.id);\n console.log(response.data.name);\n console.log(response.status);\n console.log(response.statusText);\n console.log(response.headers);\n console.log(response.config);\n};"} | |
| {"repo":"axios","file":"tests/module/esm/tests/helpers/esm-index.ts","line":231,"symbol":"handleStringResponse","kind":"constant","lang":"typescript","code":"const handleStringResponse = (response: string) => {\n console.log(response);\n};"} | |
| {"repo":"axios","file":"tests/module/esm/tests/helpers/esm-index.ts","line":278,"symbol":"instance1","kind":"constant","lang":"typescript","code":"const instance1: AxiosInstance = axios.create();"} | |
| {"repo":"axios","file":"tests/module/esm/tests/helpers/esm-index.ts","line":279,"symbol":"instance2","kind":"constant","lang":"typescript","code":"const instance2: AxiosInstance = instance1.create(config);"} | |
| {"repo":"axios","file":"tests/module/esm/tests/helpers/esm-index.ts","line":333,"symbol":"requestInterceptorId","kind":"constant","lang":"typescript","code":"const requestInterceptorId: number = axios.interceptors.request.use(\n async (config) => {\n await axios.get('/foo', {\n headers: config.headers,\n });\n return config;\n },\n (error: any) => Promise.reject(error),\n { synchronous: false }\n);"} | |
| {"repo":"axios","file":"tests/module/esm/tests/helpers/esm-index.ts","line":354,"symbol":"responseInterceptorId","kind":"constant","lang":"typescript","code":"const responseInterceptorId: number = axios.interceptors.response.use(\n (response: AxiosResponse) => response,\n (error: any) => Promise.reject(error)\n);"} | |
| {"repo":"axios","file":"tests/module/esm/tests/helpers/esm-index.ts","line":373,"symbol":"voidRequestInterceptorId","kind":"constant","lang":"typescript","code":"const voidRequestInterceptorId = axios.interceptors.request.use(\n // @ts-expect-error -- Must return an AxiosRequestConfig (or throw)\n (_response) => {},\n (error: any) => Promise.reject(error)\n);"} | |
| {"repo":"axios","file":"tests/module/esm/tests/helpers/esm-index.ts","line":378,"symbol":"voidResponseInterceptorId","kind":"constant","lang":"typescript","code":"const voidResponseInterceptorId = axios.interceptors.response.use(\n // @ts-expect-error -- Must return an AxiosResponse (or throw)\n (_response) => {},\n (error: any) => Promise.reject(error)\n);"} | |
| {"repo":"axios","file":"tests/module/esm/tests/helpers/esm-index.ts","line":394,"symbol":"adapter","kind":"constant","lang":"typescript","code":"const adapter: AxiosAdapter = (config) => {\n const response: AxiosResponse = {\n data: { foo: 'bar' },\n status: 200,\n statusText: 'OK',\n headers: { 'X-FOO': 'bar' },\n config,\n };\n return Promise.resolve(response);\n};"} | |
| {"repo":"axios","file":"tests/module/esm/tests/helpers/esm-index.ts","line":395,"symbol":"response","kind":"constant","lang":"typescript","code":"const response: AxiosResponse = {\n data: { foo: 'bar' },\n status: 200,\n statusText: 'OK',\n headers: { 'X-FOO': 'bar' },\n config,\n };"} | |
| {"repo":"axios","file":"tests/module/esm/tests/helpers/esm-index.ts","line":409,"symbol":"promises","kind":"constant","lang":"typescript","code":"const promises = [Promise.resolve(1), Promise.resolve(2)];"} | |
| {"repo":"axios","file":"tests/module/esm/tests/helpers/esm-index.ts","line":411,"symbol":"promise","kind":"constant","lang":"typescript","code":"const promise: Promise<number[]> = axios.all(promises);"} | |
| {"repo":"axios","file":"tests/module/esm/tests/helpers/esm-index.ts","line":416,"symbol":"promises","kind":"constant","lang":"typescript","code":"const promises = [Promise.resolve(1), Promise.resolve(2)];"} | |
| {"repo":"axios","file":"tests/module/esm/tests/helpers/esm-index.ts","line":418,"symbol":"promise","kind":"constant","lang":"typescript","code":"const promise: Promise<number[]> = all(promises);"} | |
| {"repo":"axios","file":"tests/module/esm/tests/helpers/esm-index.ts","line":423,"symbol":"fn1","kind":"constant","lang":"typescript","code":"const fn1 = (a: number, b: number, c: number) => `${a}-${b}-${c}`;"} | |
| {"repo":"axios","file":"tests/module/esm/tests/helpers/esm-index.ts","line":424,"symbol":"fn2","kind":"constant","lang":"typescript","code":"const fn2: (arr: number[]) => string = axios.spread(fn1);"} | |
| {"repo":"axios","file":"tests/module/esm/tests/helpers/esm-index.ts","line":428,"symbol":"fn1","kind":"constant","lang":"typescript","code":"const fn1 = (a: number, b: number, c: number) => `${a}-${b}-${c}`;"} | |
| {"repo":"axios","file":"tests/module/esm/tests/helpers/esm-index.ts","line":429,"symbol":"fn2","kind":"constant","lang":"typescript","code":"const fn2: (arr: number[]) => string = spread(fn1);"} | |
| {"repo":"axios","file":"tests/module/esm/tests/helpers/esm-index.ts","line":472,"symbol":"source","kind":"constant","lang":"typescript","code":"const source: CancelTokenSource = axios.CancelToken.source();"} | |
| {"repo":"axios","file":"tests/module/esm/tests/helpers/esm-index.ts","line":480,"symbol":"cancel","kind":"constant","lang":"typescript","code":"const cancel: Cancel = thrown;"} | |
| {"repo":"axios","file":"tests/module/esm/tests/helpers/esm-index.ts","line":486,"symbol":"cancel","kind":"constant","lang":"typescript","code":"const cancel: Cancel = thrown;"} | |
| {"repo":"axios","file":"tests/module/esm/tests/helpers/esm-index.ts","line":497,"symbol":"axiosError","kind":"constant","lang":"typescript","code":"const axiosError: AxiosError = error;"} | |
| {"repo":"axios","file":"tests/module/esm/tests/helpers/esm-index.ts","line":504,"symbol":"axiosError","kind":"constant","lang":"typescript","code":"const axiosError: AxiosError = error;"} | |
| {"repo":"axios","file":"tests/module/esm/tests/helpers/esm-index.ts","line":562,"symbol":"getRequestConfig1","kind":"function","lang":"typescript","code":"function getRequestConfig1(options: AxiosRequestConfig): AxiosRequestConfig {\n return {\n ...options,\n headers: {\n ...(options.headers as RawAxiosRequestHeaders),\n Authorization: `Bearer ...`,\n },\n };\n}"} | |
| {"repo":"axios","file":"tests/module/esm/tests/helpers/esm-index.ts","line":572,"symbol":"getRequestConfig2","kind":"function","lang":"typescript","code":"function getRequestConfig2(options: AxiosRequestConfig): AxiosRequestConfig {\n return {\n ...options,\n headers: {\n ...(options.headers as AxiosHeaders).toJSON(),\n Authorization: `Bearer ...`,\n },\n };\n}"} | |
| {"repo":"axios","file":"tests/module/esm/tests/helpers/esm-index.ts","line":630,"symbol":"_","kind":"constant","lang":"typescript","code":"const _: AxiosAdapter = getAdapter('xhr');"} | |
| {"repo":"axios","file":"tests/module/esm/tests/helpers/esm-index.ts","line":631,"symbol":"__","kind":"constant","lang":"typescript","code":"const __: AxiosAdapter = getAdapter(['xhr']);"} | |
| {"repo":"axios","file":"tests/module/esm/tests/helpers/esm-index.ts","line":647,"symbol":"headers","kind":"constant","lang":"typescript","code":"const headers = new AxiosHeaders({ foo: 'bar' });"} | |
| {"repo":"axios","file":"tests/module/esm/tests/helpers/esm-index.ts","line":656,"symbol":"headers","kind":"constant","lang":"typescript","code":"const headers = new AxiosHeaders({ x: 1 });"} | |
| {"repo":"axios","file":"tests/module/esm/tests/helpers/esm-index.ts","line":664,"symbol":"headers","kind":"constant","lang":"typescript","code":"const headers: AxiosRequestHeaders = new AxiosHeaders({ x: 1 });"} | |
| {"repo":"axios","file":"tests/module/esm/tests/helpers/esm-index.ts","line":674,"symbol":"requestInterceptorId","kind":"constant","lang":"typescript","code":"const requestInterceptorId: number = axios.interceptors.request.use(\n async (config) => {\n config.headers.Accept = 'foo';\n config.headers.setAccept('foo');\n config.headers = new AxiosHeaders({ x: 1 });\n config.headers.foo = '1';\n config.headers.set('bar', '2');\n config.headers.set({ myHeader: 'myValue' });\n config.headers = new AxiosHeaders({ myHeader: 'myValue' });\n config.headers = { ...config.headers } as AxiosRequestHeaders;\n return config;\n },\n (error: any) => Promise.reject(error)\n );"} | |
| {"repo":"axios","file":"tests/module/esm/tests/helpers/esm-index.ts","line":691,"symbol":"config","kind":"constant","lang":"typescript","code":"const config: AxiosRequestConfig = { headers: new AxiosHeaders({ foo: 1 }) };"} | |
| {"repo":"axios","file":"tests/module/esm/tests/helpers/esm-index.ts","line":723,"symbol":"causeMessage","kind":"constant","lang":"typescript","doc":"This should not produce a type error - cause is typed as Error","code":"const causeMessage: string | undefined = error.cause.message;"} | |
| {"repo":"axios","file":"tests/setup/formBodyLengthCases.js","line":8,"symbol":"formBodyLengthCases","kind":"function","lang":"javascript","code":"function formBodyLengthCases() {\n describe('fetch multipart body length', () => {\n class StreamingRequest extends Request {\n arrayBuffer() {\n throw new Error('Multipart measurement must not buffer the complete body');\n }\n }\n\n const makeForm = () => {\n const form = new FormData();\n form.append('message', 'café\\nsecond line');\n form.append('file', new Blob(['contents'], { type: 'text/plain' }), 'note.txt');\n return form;\n };\n\n it('uses each configured Blob constructor when reusing a fetch implementation', async () => {\n const created = [];\n class FirstBlob extends Blob {\n constructor(parts, options) {\n super(parts, options);\n created.push(this);\n }\n }\n class SecondBlob extends FirstBlob {}\n const envFetch = async (request) => {\n const form = await request.formData();\n expect(form.get('message')).toBe('café\\r\\nsecond line');\n expect(await form.get('file').text()).toBe('contents');\n return new Response('ok');\n };\n for (const BlobConstructor of [FirstBlob, SecondBlob, FirstBlob]) {\n const before = created.length;\n const respons"} | |
| {"repo":"axios","file":"tests/setup/formBodyLengthCases.js","line":10,"symbol":"StreamingRequest","kind":"class","lang":"javascript","code":"class StreamingRequest extends Request {\n arrayBuffer() {\n throw new Error('Multipart measurement must not buffer the complete body');\n }\n }"} | |
| {"repo":"axios","file":"tests/setup/formBodyLengthCases.js","line":11,"symbol":"arrayBuffer","kind":"method","lang":"javascript","code":"arrayBuffer() {\n throw new Error('Multipart measurement must not buffer the complete body');\n }"} | |
| {"repo":"axios","file":"tests/setup/formBodyLengthCases.js","line":25,"symbol":"FirstBlob","kind":"class","lang":"javascript","code":"class FirstBlob extends Blob {\n constructor(parts, options) {\n super(parts, options);\n created.push(this);\n }\n }"} | |
| {"repo":"axios","file":"tests/setup/formBodyLengthCases.js","line":26,"symbol":"constructor","kind":"method","lang":"javascript","code":"constructor(parts, options) {\n super(parts, options);\n created.push(this);\n }"} | |
| {"repo":"axios","file":"tests/setup/formBodyLengthCases.js","line":31,"symbol":"SecondBlob","kind":"class","lang":"javascript","code":"class SecondBlob extends FirstBlob {}"} | |
| {"repo":"axios","file":"tests/setup/formBodyLengthCases.js","line":58,"symbol":"CustomBlob","kind":"class","lang":"javascript","code":"class CustomBlob extends NativeBlob {\n constructor(parts, options) {\n super(parts, options);\n constructed = true;\n }\n }"} | |
| {"repo":"axios","file":"tests/setup/formBodyLengthCases.js","line":59,"symbol":"constructor","kind":"method","lang":"javascript","code":"constructor(parts, options) {\n super(parts, options);\n constructed = true;\n }"} | |
| {"repo":"axios","file":"tests/setup/formBodyLengthCases.js","line":72,"symbol":"fetch","kind":"method","lang":"javascript","code":"async fetch(request) {\n const decoded = await request.formData();\n expect(decoded.get('message')).toBe('café\\r\\nsecond line');\n expect(await decoded.get('file').text()).toBe('contents');\n return new Response('ok');\n }"} | |
| {"repo":"axios","file":"tests/setup/formBodyLengthCases.js","line":92,"symbol":"fetch","kind":"method","lang":"javascript","code":"async fetch(request) {\n expect((await request.formData()).get('message')).toBe('café\\r\\nsecond line');\n return new Response('ok');\n }"} | |
| {"repo":"axios","file":"tests/setup/formBodyLengthCases.js","line":116,"symbol":"fetch","kind":"method","lang":"javascript","code":"async fetch(request) {\n const form = await request.formData();\n expect(form.get('message')).toBe('café\\r\\nsecond line');\n expect(form.get('file').name).toBe('note.txt');\n expect(await form.get('file').text()).toBe('contents');\n return new Response('ok');\n }"} | |
| {"repo":"axios","file":"tests/setup/formBodyLengthCases.js","line":147,"symbol":"fetch","kind":"method","lang":"javascript","code":"async fetch(request) {\n expect(request.headers.get('content-type')).toBe(contentType);\n const body = await request.text();\n expect(body).toBe(\n [\n '--' + boundary,\n 'Content-Disposition: form-data; name=\"message\"',\n '',\n 'café',\n 'second line',\n '--' + boundary,\n 'Content-Disposition: form-data; name=\"file\"; filename=\"note.txt\"',\n 'Content-Type: text/plain',\n '',\n 'contents',\n '--' + boundary + '--',\n '',\n ].join('\\r\\n')\n );\n return new Response('ok');\n }"} | |
| {"repo":"axios","file":"tests/setup/formBodyLengthCases.js","line":191,"symbol":"fetch","kind":"method","lang":"javascript","code":"async fetch(request) {\n calls++;\n const decoded = await request.formData();\n expect(await decoded.get('file').text()).toBe('contents');\n return new Response('ok');\n }"} | |
| {"repo":"axios","file":"tests/setup/formBodyLengthCases.js","line":347,"symbol":"fetch","kind":"method","lang":"javascript","code":"fetch() {\n calls++;\n return Promise.resolve(new Response('unexpected'));\n }"} | |
| {"repo":"axios","file":"tests/setup/formBodyLengthCases.js","line":369,"symbol":"CountedBlob","kind":"class","lang":"javascript","code":"class CountedBlob extends Blob {\n constructor(parts, options) {\n constructions++;\n super(parts, options);\n }\n }"} | |
| {"repo":"axios","file":"tests/setup/formBodyLengthCases.js","line":370,"symbol":"constructor","kind":"method","lang":"javascript","code":"constructor(parts, options) {\n constructions++;\n super(parts, options);\n }"} | |
| {"repo":"axios","file":"tests/setup/formBodyLengthCases.js","line":395,"symbol":"SizedRequest","kind":"class","lang":"javascript","code":"class SizedRequest extends StreamingRequest {\n constructor(url, init) {\n if (init && init.body instanceof FormData) {\n throw new Error('Unexpected native multipart serialization');\n }\n super(url, init);\n }\n }"} | |
| {"repo":"axios","file":"tests/setup/formBodyLengthCases.js","line":396,"symbol":"constructor","kind":"method","lang":"javascript","code":"constructor(url, init) {\n if (init && init.body instanceof FormData) {\n throw new Error('Unexpected native multipart serialization');\n }\n super(url, init);\n }"} | |
| {"repo":"axios","file":"tests/setup/formBodyLengthCases.js","line":415,"symbol":"fetch","kind":"method","lang":"javascript","code":"fetch() {\n throw new Error('Unexpected dispatch');\n }"} | |
| {"repo":"axios","file":"tests/setup/formBodyLengthCases.js","line":426,"symbol":"fetch","kind":"method","lang":"javascript","code":"async fetch(request) {\n const decoded = await request.formData();\n expect(await decoded.get('file').text()).toBe('contents');\n return new Response('ok');\n }"} | |
| {"repo":"axios","file":"tests/setup/formBodyLengthCases.js","line":437,"symbol":"StreamingResponse","kind":"class","lang":"javascript","code":"class StreamingResponse extends Response {\n arrayBuffer() {\n throw new Error('Unexpected body buffering');\n }\n }"} | |
| {"repo":"axios","file":"tests/setup/formBodyLengthCases.js","line":438,"symbol":"arrayBuffer","kind":"method","lang":"javascript","code":"arrayBuffer() {\n throw new Error('Unexpected body buffering');\n }"} | |
| {"repo":"axios","file":"tests/setup/formBodyLengthCases.js","line":449,"symbol":"fetch","kind":"method","lang":"javascript","code":"fetch(_url, options) {\n expect(options.body instanceof Blob).toBe(true);\n expect(options.body.size).toBeLessThan(4096);\n return Promise.resolve(new Response('ok'));\n }"} | |
| {"repo":"axios","file":"tests/setup/formBodyLengthCases.js","line":466,"symbol":"fetch","kind":"method","lang":"javascript","code":"async fetch(_url, options) {\n const decoded = await new Response(options.body).formData();\n expect(await decoded.get('file').text()).toBe('contents');\n return new Response('ok');\n }"} | |
| {"repo":"axios","file":"tests/setup/formBodyLengthCases.js","line":488,"symbol":"fetch","kind":"method","lang":"javascript","code":"fetch() {\n calls++;\n return Promise.resolve(new Response('unexpected'));\n }"} | |
| {"repo":"axios","file":"tests/setup/runModuleInChildProcess.js","line":3,"symbol":"runModuleInChildProcess","kind":"function","lang":"javascript","code":"function runModuleInChildProcess(source, options) {\n return new Promise(function (resolve, reject) {\n execFile(\n process.execPath,\n ['--input-type=module', '-e', source],\n Object.assign({ timeout: 3000, killSignal: 'SIGKILL' }, options),\n function (error, stdout, stderr) {\n if (error) {\n error.stdout = stdout;\n error.stderr = stderr;\n return reject(error);\n }\n resolve(stdout);\n }\n );\n });\n}"} | |
| {"repo":"axios","file":"tests/setup/server.js","line":190,"symbol":"pull","kind":"method","lang":"javascript","code":"async pull(controller) {\n await setTimeoutAsync(timeout);\n n-- ? controller.enqueue(chunk) : controller.close();\n }"} | |
| {"repo":"axios","file":"tests/setup/server.js","line":203,"symbol":"write","kind":"method","lang":"javascript","code":"write(chunk) {\n echo && console.log('Echo chunk', chunk);\n }"} | |
| {"repo":"axios","file":"tests/smoke/bun/tests/cancel.smoke.test.ts","line":4,"symbol":"env","kind":"constant","lang":"typescript","code":"const env = (fetch: typeof globalThis.fetch) => ({\n fetch,\n Request,\n Response,\n});"} | |
| {"repo":"axios","file":"tests/smoke/bun/tests/cancel.smoke.test.ts","line":14,"symbol":"fetch","kind":"constant","lang":"typescript","code":"const fetch = async () => {\n fetchCallCount += 1;\n\n return new Response(JSON.stringify({ ok: true }), {\n status: 200,\n headers: { 'Content-Type': 'application/json' },\n });\n };"} | |
| {"repo":"axios","file":"tests/smoke/bun/tests/cancel.smoke.test.ts","line":23,"symbol":"controller","kind":"constant","lang":"typescript","code":"const controller = new AbortController();"} | |
| {"repo":"axios","file":"tests/smoke/bun/tests/cancel.smoke.test.ts","line":26,"symbol":"err","kind":"constant","lang":"typescript","code":"const err = await axios\n .get('https://example.com/cancel', {\n adapter: 'fetch',\n signal: controller.signal,\n env: env(fetch),\n })\n .catch((e: any) => e);"} | |
| {"repo":"axios","file":"tests/smoke/bun/tests/cancel.smoke.test.ts","line":40,"symbol":"fetch","kind":"constant","lang":"typescript","code":"const fetch = (_input: unknown, init?: RequestInit) =>\n new Promise<Response>((_resolve, reject) => {\n const abortError = () =>\n reject(new DOMException('The operation was aborted', 'AbortError'));\n\n const timeout = setTimeout(abortError, 20);\n\n if (init?.signal) {\n if (init.signal.aborted) {\n clearTimeout(timeout);\n abortError();\n return;\n }\n\n init.signal.addEventListener(\n 'abort',\n () => {\n clearTimeout(timeout);\n abortError();\n },\n { once: true }\n );\n }\n });"} | |
| {"repo":"axios","file":"tests/smoke/bun/tests/cancel.smoke.test.ts","line":42,"symbol":"abortError","kind":"constant","lang":"typescript","code":"const abortError = () =>\n reject(new DOMException('The operation was aborted', 'AbortError'));"} | |
| {"repo":"axios","file":"tests/smoke/bun/tests/cancel.smoke.test.ts","line":45,"symbol":"timeout","kind":"constant","lang":"typescript","code":"const timeout = setTimeout(abortError, 20);"} | |
| {"repo":"axios","file":"tests/smoke/bun/tests/cancel.smoke.test.ts","line":65,"symbol":"controller","kind":"constant","lang":"typescript","code":"const controller = new AbortController();"} | |
| {"repo":"axios","file":"tests/smoke/bun/tests/cancel.smoke.test.ts","line":67,"symbol":"request","kind":"constant","lang":"typescript","code":"const request = axios.get('https://example.com/in-flight', {\n adapter: 'fetch',\n signal: controller.signal,\n env: env(fetch),\n });"} | |
| {"repo":"axios","file":"tests/smoke/bun/tests/cancel.smoke.test.ts","line":75,"symbol":"err","kind":"constant","lang":"typescript","code":"const err = await request.catch((e: any) => e);"} | |
| {"repo":"axios","file":"tests/smoke/bun/tests/error.smoke.test.ts","line":4,"symbol":"env","kind":"constant","lang":"typescript","code":"const env = (fetch: typeof globalThis.fetch) => ({\n fetch,\n Request,\n Response,\n});"} | |
| {"repo":"axios","file":"tests/smoke/bun/tests/error.smoke.test.ts","line":12,"symbol":"fetch","kind":"constant","lang":"typescript","code":"const fetch = async () =>\n new Response(JSON.stringify({ error: 'missing' }), {\n status: 404,\n statusText: 'Not Found',\n headers: { 'Content-Type': 'application/json' },\n });"} | |
| {"repo":"axios","file":"tests/smoke/bun/tests/error.smoke.test.ts","line":19,"symbol":"err","kind":"constant","lang":"typescript","code":"const err = await axios\n .get('https://example.com/missing', {\n adapter: 'fetch',\n env: env(fetch),\n })\n .catch((e: any) => e);"} | |
| {"repo":"axios","file":"tests/smoke/bun/tests/fetch.smoke.test.ts","line":4,"symbol":"createFetchMock","kind":"constant","lang":"typescript","code":"const createFetchMock = (\n responseFactory?: (input: unknown, init: RequestInit) => Response | Promise<Response>\n) => {\n const calls: Array<{ input: unknown; init: RequestInit }> = [];\n\n const mockFetch = async (input: unknown, init: RequestInit = {}) => {\n calls.push({ input, init });\n\n if (responseFactory) {\n return responseFactory(input, init);\n }\n\n return new Response(JSON.stringify({ ok: true }), {\n status: 200,\n headers: { 'Content-Type': 'application/json' },\n });\n };\n\n return {\n mockFetch,\n getCalls: () => calls,\n };\n};"} | |
| {"repo":"axios","file":"tests/smoke/bun/tests/fetch.smoke.test.ts","line":7,"symbol":"calls","kind":"constant","lang":"typescript","code":"const calls: Array<{ input: unknown; init: RequestInit }> = [];"} | |
| {"repo":"axios","file":"tests/smoke/bun/tests/fetch.smoke.test.ts","line":9,"symbol":"mockFetch","kind":"constant","lang":"typescript","code":"const mockFetch = async (input: unknown, init: RequestInit = {}) => {\n calls.push({ input, init });\n\n if (responseFactory) {\n return responseFactory(input, init);\n }\n\n return new Response(JSON.stringify({ ok: true }), {\n status: 200,\n headers: { 'Content-Type': 'application/json' },\n });\n };"} | |
| {"repo":"axios","file":"tests/smoke/bun/tests/fetch.smoke.test.ts","line":28,"symbol":"getRequestMeta","kind":"constant","lang":"typescript","code":"const getRequestMeta = async (input: unknown, init: RequestInit = {}) => {\n const request = input instanceof Request ? input : new Request(input as string, init);\n\n return {\n url: request.url,\n method: request.method,\n body:\n request.method === 'GET' || request.method === 'HEAD'\n ? undefined\n : await request.clone().text(),\n };\n};"} | |
| {"repo":"axios","file":"tests/smoke/bun/tests/fetch.smoke.test.ts","line":29,"symbol":"request","kind":"constant","lang":"typescript","code":"const request = input instanceof Request ? input : new Request(input as string, init);"} | |
| {"repo":"axios","file":"tests/smoke/bun/tests/fetch.smoke.test.ts","line":41,"symbol":"env","kind":"constant","lang":"typescript","code":"const env = (fetch: typeof globalThis.fetch) => ({\n fetch,\n Request,\n Response,\n});"} | |
| {"repo":"axios","file":"tests/smoke/bun/tests/fetch.smoke.test.ts","line":51,"symbol":"response","kind":"constant","lang":"typescript","code":"const response = await axios.get('https://example.com/users', {\n adapter: 'fetch',\n env: env(mockFetch),\n });"} | |
| {"repo":"axios","file":"tests/smoke/bun/tests/fetch.smoke.test.ts","line":74,"symbol":"meta","kind":"constant","lang":"typescript","code":"const meta = await getRequestMeta(input, init);"} | |
| {"repo":"axios","file":"tests/smoke/bun/tests/fetch.smoke.test.ts","line":79,"symbol":"run","kind":"constant","lang":"typescript","code":"const run = async (\n method: 'delete' | 'head' | 'options' | 'put' | 'patch',\n expected: string\n ) => {\n const { mockFetch, getCalls } = createFetchMock();\n\n if (method === 'put' || method === 'patch') {\n await axios[method](\n 'https://example.com/items',\n { name: 'widget' },\n {\n adapter: 'fetch',\n env: env(mockFetch),\n }\n );\n } else {\n await axios[method]('https://example.com/items', {\n adapter: 'fetch',\n env: env(mockFetch),\n });\n }\n\n const { input, init } = getCalls()[0];\n const meta = await getRequestMeta(input, init);\n expect(meta.method).toBe(expected);\n };"} | |
| {"repo":"axios","file":"tests/smoke/bun/tests/fetch.smoke.test.ts","line":102,"symbol":"meta","kind":"constant","lang":"typescript","code":"const meta = await getRequestMeta(input, init);"} | |
| {"repo":"axios","file":"tests/smoke/bun/tests/fetch.smoke.test.ts","line":122,"symbol":"meta","kind":"constant","lang":"typescript","code":"const meta = await getRequestMeta(input, init);"} | |
| {"repo":"axios","file":"tests/smoke/bun/tests/formData.smoke.test.ts","line":6,"symbol":"createTransportMock","kind":"constant","lang":"typescript","code":"const createTransportMock = (\n responseFactory?: (body: Buffer, options: Record<string, any>) => Record<string, any>\n) => {\n const transport = {\n request(options: Record<string, any>, onResponse: (res: PassThrough) => void) {\n const chunks: Buffer[] = [];\n\n const req = new Writable({\n write(chunk, _encoding, callback) {\n chunks.push(Buffer.from(chunk));\n callback();\n },\n }) as Writable & Record<string, any>;\n\n req.destroyed = false;\n req.setTimeout = () => {};\n req.write = req.write.bind(req);\n req.destroy = () => {\n req.destroyed = true;\n return req;\n };\n req.close = req.destroy;\n const originalEnd = req.end.bind(req);\n req.end = (...args: unknown[]) => {\n originalEnd(...(args as Parameters<Writable['end']>));\n\n const body = Buffer.concat(chunks);\n const response = responseFactory ? responseFactory(body, options) : {};\n\n const res = new PassThrough() as PassThrough & Record<string, any>;\n res.statusCode = response.statusCode ?? 200;\n res.statusMessage = response.statusMessage ?? 'OK';\n res.headers = response.headers ?? { 'conten"} | |
| {"repo":"axios","file":"tests/smoke/bun/tests/formData.smoke.test.ts","line":9,"symbol":"transport","kind":"constant","lang":"typescript","code":"const transport = {\n request(options: Record<string, any>, onResponse: (res: PassThrough) => void) {\n const chunks: Buffer[] = [];\n\n const req = new Writable({\n write(chunk, _encoding, callback) {\n chunks.push(Buffer.from(chunk));\n callback();\n },\n }) as Writable & Record<string, any>;\n\n req.destroyed = false;\n req.setTimeout = () => {};\n req.write = req.write.bind(req);\n req.destroy = () => {\n req.destroyed = true;\n return req;\n };\n req.close = req.destroy;\n const originalEnd = req.end.bind(req);\n req.end = (...args: unknown[]) => {\n originalEnd(...(args as Parameters<Writable['end']>));\n\n const body = Buffer.concat(chunks);\n const response = responseFactory ? responseFactory(body, options) : {};\n\n const res = new PassThrough() as PassThrough & Record<string, any>;\n res.statusCode = response.statusCode ?? 200;\n res.statusMessage = response.statusMessage ?? 'OK';\n res.headers = response.headers ?? { 'content-type': 'application/json' };\n res.req = req;\n\n onResponse(res);\n res.end(response.body ?? JSON.stringify"} | |
| {"repo":"axios","file":"tests/smoke/bun/tests/formData.smoke.test.ts","line":10,"symbol":"request","kind":"method","lang":"typescript","code":"request(options: Record<string, any>, onResponse: (res: PassThrough) => void) {\n const chunks: Buffer[] = [];\n\n const req = new Writable({\n write(chunk, _encoding, callback) {\n chunks.push(Buffer.from(chunk));\n callback();\n },\n }) as Writable & Record<string, any>;\n\n req.destroyed = false;\n req.setTimeout = () => {};\n req.write = req.write.bind(req);\n req.destroy = () => {\n req.destroyed = true;\n return req;\n };\n req.close = req.destroy;\n const originalEnd = req.end.bind(req);\n req.end = (...args: unknown[]) => {\n originalEnd(...(args as Parameters<Writable['end']>));\n\n const body = Buffer.concat(chunks);\n const response = responseFactory ? responseFactory(body, options) : {};\n\n const res = new PassThrough() as PassThrough & Record<string, any>;\n res.statusCode = response.statusCode ?? 200;\n res.statusMessage = response.statusMessage ?? 'OK';\n res.headers = response.headers ?? { 'content-type': 'application/json' };\n res.req = req;\n\n onResponse(res);\n res.end(response.body ?? JSON.stringify({ ok: true }));\n\n "} | |
| {"repo":"axios","file":"tests/smoke/bun/tests/formData.smoke.test.ts","line":11,"symbol":"chunks","kind":"constant","lang":"typescript","code":"const chunks: Buffer[] = [];"} | |
| {"repo":"axios","file":"tests/smoke/bun/tests/formData.smoke.test.ts","line":13,"symbol":"req","kind":"constant","lang":"typescript","code":"const req = new Writable({\n write(chunk, _encoding, callback) {\n chunks.push(Buffer.from(chunk));\n callback();\n },\n }) as Writable & Record<string, any>;"} | |
| {"repo":"axios","file":"tests/smoke/bun/tests/formData.smoke.test.ts","line":14,"symbol":"write","kind":"method","lang":"typescript","code":"write(chunk, _encoding, callback) {\n chunks.push(Buffer.from(chunk));\n callback();\n }"} | |
| {"repo":"axios","file":"tests/smoke/bun/tests/formData.smoke.test.ts","line":28,"symbol":"originalEnd","kind":"constant","lang":"typescript","code":"const originalEnd = req.end.bind(req);"} | |
| {"repo":"axios","file":"tests/smoke/bun/tests/formData.smoke.test.ts","line":32,"symbol":"body","kind":"constant","lang":"typescript","code":"const body = Buffer.concat(chunks);"} | |
| {"repo":"axios","file":"tests/smoke/bun/tests/formData.smoke.test.ts","line":33,"symbol":"response","kind":"constant","lang":"typescript","code":"const response = responseFactory ? responseFactory(body, options) : {};"} | |
| {"repo":"axios","file":"tests/smoke/bun/tests/formData.smoke.test.ts","line":35,"symbol":"res","kind":"constant","lang":"typescript","code":"const res = new PassThrough() as PassThrough & Record<string, any>;"} | |
| {"repo":"axios","file":"tests/smoke/bun/tests/formData.smoke.test.ts","line":54,"symbol":"bodyAsUtf8","kind":"constant","lang":"typescript","code":"const bodyAsUtf8 = (value: unknown) => {\n return Buffer.isBuffer(value) ? value.toString('utf8') : String(value);\n};"} | |
| {"repo":"axios","file":"tests/smoke/bun/tests/formData.smoke.test.ts","line":60,"symbol":"form","kind":"constant","lang":"typescript","code":"const form = new FormData();"} | |
| {"repo":"axios","file":"tests/smoke/bun/tests/formData.smoke.test.ts","line":72,"symbol":"response","kind":"constant","lang":"typescript","code":"const response = await axios.post('http://example.com/form', form, {\n adapter: 'http',\n proxy: false,\n transport,\n });"} | |
| {"repo":"axios","file":"tests/smoke/bun/tests/formData.smoke.test.ts","line":86,"symbol":"form","kind":"constant","lang":"typescript","code":"const form = new FormDataPackage();"} | |
| {"repo":"axios","file":"tests/smoke/bun/tests/formData.smoke.test.ts","line":98,"symbol":"response","kind":"constant","lang":"typescript","code":"const response = await axios.post('http://example.com/npm-form-data', form as any, {\n adapter: 'http',\n proxy: false,\n transport,\n });"} | |
| {"repo":"axios","file":"tests/smoke/bun/tests/headers.smoke.test.ts","line":4,"symbol":"createFetchCapture","kind":"constant","lang":"typescript","code":"const createFetchCapture = () => {\n const calls: Request[] = [];\n\n const fetch = async (input: unknown, init?: RequestInit) => {\n const request = input instanceof Request ? input : new Request(input as string, init);\n calls.push(request);\n\n return new Response(JSON.stringify({ ok: true }), {\n status: 200,\n headers: { 'Content-Type': 'application/json' },\n });\n };\n\n return {\n fetch,\n getCalls: () => calls,\n };\n};"} | |
| {"repo":"axios","file":"tests/smoke/bun/tests/headers.smoke.test.ts","line":5,"symbol":"calls","kind":"constant","lang":"typescript","code":"const calls: Request[] = [];"} | |
| {"repo":"axios","file":"tests/smoke/bun/tests/headers.smoke.test.ts","line":7,"symbol":"fetch","kind":"constant","lang":"typescript","code":"const fetch = async (input: unknown, init?: RequestInit) => {\n const request = input instanceof Request ? input : new Request(input as string, init);\n calls.push(request);\n\n return new Response(JSON.stringify({ ok: true }), {\n status: 200,\n headers: { 'Content-Type': 'application/json' },\n });\n };"} | |
| {"repo":"axios","file":"tests/smoke/bun/tests/headers.smoke.test.ts","line":8,"symbol":"request","kind":"constant","lang":"typescript","code":"const request = input instanceof Request ? input : new Request(input as string, init);"} | |
| {"repo":"axios","file":"tests/smoke/bun/tests/headers.smoke.test.ts","line":23,"symbol":"env","kind":"constant","lang":"typescript","code":"const env = (fetch: typeof globalThis.fetch) => ({\n fetch,\n Request,\n Response,\n});"} | |
| {"repo":"axios","file":"tests/smoke/bun/tests/headers.smoke.test.ts","line":41,"symbol":"request","kind":"constant","lang":"typescript","code":"const request = getCalls()[0];"} | |
| {"repo":"axios","file":"tests/smoke/bun/tests/headers.smoke.test.ts","line":57,"symbol":"request","kind":"constant","lang":"typescript","code":"const request = getCalls()[0];"} | |
| {"repo":"axios","file":"tests/smoke/bun/tests/headers.smoke.test.ts","line":58,"symbol":"contentType","kind":"constant","lang":"typescript","code":"const contentType = request.headers.get('content-type') || '';"} | |
| {"repo":"axios","file":"tests/smoke/bun/tests/http.smoke.test.ts","line":6,"symbol":"TransportCall","kind":"type","lang":"typescript","code":"type TransportCall = {\n options: Record<string, any>;\n body: Buffer;\n};"} | |
| {"repo":"axios","file":"tests/smoke/bun/tests/http.smoke.test.ts","line":11,"symbol":"createTransportMock","kind":"constant","lang":"typescript","code":"const createTransportMock = (\n responseFactory?: (body: Buffer, options: Record<string, any>) => Record<string, any>\n) => {\n const calls: TransportCall[] = [];\n\n const transport = {\n request(options: Record<string, any>, onResponse: (res: PassThrough) => void) {\n const req = new EventEmitter() as Record<string, any>;\n const chunks: Buffer[] = [];\n\n req.destroyed = false;\n req.setTimeout = () => {};\n req.write = (chunk?: unknown) => {\n if (chunk !== undefined) {\n chunks.push(Buffer.from(chunk as string));\n }\n return true;\n };\n req.destroy = () => {\n req.destroyed = true;\n };\n req.close = req.destroy;\n req.end = (chunk?: unknown) => {\n if (chunk !== undefined) {\n chunks.push(Buffer.from(chunk as string));\n }\n\n const body = Buffer.concat(chunks);\n calls.push({ options, body });\n\n const response = responseFactory ? responseFactory(body, options) : {};\n const res = new PassThrough() as PassThrough & Record<string, any>;\n res.statusCode = response.statusCode ?? 200;\n res.statusMessage = response.statusMessage ?? 'OK';\n res.he"} | |
| {"repo":"axios","file":"tests/smoke/bun/tests/http.smoke.test.ts","line":14,"symbol":"calls","kind":"constant","lang":"typescript","code":"const calls: TransportCall[] = [];"} | |
| {"repo":"axios","file":"tests/smoke/bun/tests/http.smoke.test.ts","line":16,"symbol":"transport","kind":"constant","lang":"typescript","code":"const transport = {\n request(options: Record<string, any>, onResponse: (res: PassThrough) => void) {\n const req = new EventEmitter() as Record<string, any>;\n const chunks: Buffer[] = [];\n\n req.destroyed = false;\n req.setTimeout = () => {};\n req.write = (chunk?: unknown) => {\n if (chunk !== undefined) {\n chunks.push(Buffer.from(chunk as string));\n }\n return true;\n };\n req.destroy = () => {\n req.destroyed = true;\n };\n req.close = req.destroy;\n req.end = (chunk?: unknown) => {\n if (chunk !== undefined) {\n chunks.push(Buffer.from(chunk as string));\n }\n\n const body = Buffer.concat(chunks);\n calls.push({ options, body });\n\n const response = responseFactory ? responseFactory(body, options) : {};\n const res = new PassThrough() as PassThrough & Record<string, any>;\n res.statusCode = response.statusCode ?? 200;\n res.statusMessage = response.statusMessage ?? 'OK';\n res.headers = response.headers ?? { 'content-type': 'application/json' };\n res.req = req;\n\n onResponse(res);\n res.end(response.body ?? JSON.stringify("} | |
| {"repo":"axios","file":"tests/smoke/bun/tests/http.smoke.test.ts","line":17,"symbol":"request","kind":"method","lang":"typescript","code":"request(options: Record<string, any>, onResponse: (res: PassThrough) => void) {\n const req = new EventEmitter() as Record<string, any>;\n const chunks: Buffer[] = [];\n\n req.destroyed = false;\n req.setTimeout = () => {};\n req.write = (chunk?: unknown) => {\n if (chunk !== undefined) {\n chunks.push(Buffer.from(chunk as string));\n }\n return true;\n };\n req.destroy = () => {\n req.destroyed = true;\n };\n req.close = req.destroy;\n req.end = (chunk?: unknown) => {\n if (chunk !== undefined) {\n chunks.push(Buffer.from(chunk as string));\n }\n\n const body = Buffer.concat(chunks);\n calls.push({ options, body });\n\n const response = responseFactory ? responseFactory(body, options) : {};\n const res = new PassThrough() as PassThrough & Record<string, any>;\n res.statusCode = response.statusCode ?? 200;\n res.statusMessage = response.statusMessage ?? 'OK';\n res.headers = response.headers ?? { 'content-type': 'application/json' };\n res.req = req;\n\n onResponse(res);\n res.end(response.body ?? JSON.stringify({ ok: true }));\n };"} | |
| {"repo":"axios","file":"tests/smoke/bun/tests/http.smoke.test.ts","line":18,"symbol":"req","kind":"constant","lang":"typescript","code":"const req = new EventEmitter() as Record<string, any>;"} | |
| {"repo":"axios","file":"tests/smoke/bun/tests/http.smoke.test.ts","line":19,"symbol":"chunks","kind":"constant","lang":"typescript","code":"const chunks: Buffer[] = [];"} | |
| {"repo":"axios","file":"tests/smoke/bun/tests/http.smoke.test.ts","line":38,"symbol":"body","kind":"constant","lang":"typescript","code":"const body = Buffer.concat(chunks);"} | |
| {"repo":"axios","file":"tests/smoke/bun/tests/http.smoke.test.ts","line":41,"symbol":"response","kind":"constant","lang":"typescript","code":"const response = responseFactory ? responseFactory(body, options) : {};"} | |
| {"repo":"axios","file":"tests/smoke/bun/tests/http.smoke.test.ts","line":42,"symbol":"res","kind":"constant","lang":"typescript","code":"const res = new PassThrough() as PassThrough & Record<string, any>;"} | |
| {"repo":"axios","file":"tests/smoke/bun/tests/http.smoke.test.ts","line":66,"symbol":"response","kind":"constant","lang":"typescript","code":"const response = await axios.get('http://example.com/users', {\n adapter: 'http',\n proxy: false,\n transport,\n });"} | |
| {"repo":"axios","file":"tests/smoke/bun/tests/import.smoke.test.ts","line":10,"symbol":"exports","kind":"constant","lang":"typescript","code":"const exports = (await import('axios')) as Record<string, any>;"} | |
| {"repo":"axios","file":"tests/smoke/bun/tests/interceptors.smoke.test.ts","line":4,"symbol":"createFetchCapture","kind":"constant","lang":"typescript","code":"const createFetchCapture = () => {\n const calls: Request[] = [];\n\n const fetch = async (input: unknown, init?: RequestInit) => {\n const request = input instanceof Request ? input : new Request(input as string, init);\n calls.push(request);\n\n return new Response(JSON.stringify({ value: 'ok' }), {\n status: 200,\n headers: { 'Content-Type': 'application/json' },\n });\n };\n\n return {\n fetch,\n getCalls: () => calls,\n };\n};"} | |
| {"repo":"axios","file":"tests/smoke/bun/tests/interceptors.smoke.test.ts","line":5,"symbol":"calls","kind":"constant","lang":"typescript","code":"const calls: Request[] = [];"} | |
| {"repo":"axios","file":"tests/smoke/bun/tests/interceptors.smoke.test.ts","line":7,"symbol":"fetch","kind":"constant","lang":"typescript","code":"const fetch = async (input: unknown, init?: RequestInit) => {\n const request = input instanceof Request ? input : new Request(input as string, init);\n calls.push(request);\n\n return new Response(JSON.stringify({ value: 'ok' }), {\n status: 200,\n headers: { 'Content-Type': 'application/json' },\n });\n };"} | |
| {"repo":"axios","file":"tests/smoke/bun/tests/interceptors.smoke.test.ts","line":8,"symbol":"request","kind":"constant","lang":"typescript","code":"const request = input instanceof Request ? input : new Request(input as string, init);"} | |
| {"repo":"axios","file":"tests/smoke/bun/tests/interceptors.smoke.test.ts","line":23,"symbol":"env","kind":"constant","lang":"typescript","code":"const env = (fetch: typeof globalThis.fetch) => ({\n fetch,\n Request,\n Response,\n});"} | |
| {"repo":"axios","file":"tests/smoke/bun/tests/interceptors.smoke.test.ts","line":32,"symbol":"client","kind":"constant","lang":"typescript","code":"const client = axios.create({\n adapter: 'fetch',\n env: env(fetch),\n });"} | |
| {"repo":"axios","file":"tests/smoke/bun/tests/interceptors.smoke.test.ts","line":51,"symbol":"client","kind":"constant","lang":"typescript","code":"const client = axios.create({\n adapter: 'fetch',\n env: env(fetch),\n });"} | |
| {"repo":"axios","file":"tests/smoke/bun/tests/interceptors.smoke.test.ts","line":61,"symbol":"response","kind":"constant","lang":"typescript","code":"const response = await client.get('https://example.com/interceptor-response');"} | |
| {"repo":"axios","file":"tests/smoke/bun/tests/progress.smoke.test.ts","line":4,"symbol":"env","kind":"constant","lang":"typescript","code":"const env = (fetch: typeof globalThis.fetch) => ({\n fetch,\n Request,\n Response,\n});"} | |
| {"repo":"axios","file":"tests/smoke/bun/tests/progress.smoke.test.ts","line":12,"symbol":"samples","kind":"constant","lang":"typescript","code":"const samples: number[] = [];"} | |
| {"repo":"axios","file":"tests/smoke/bun/tests/progress.smoke.test.ts","line":14,"symbol":"fetch","kind":"constant","lang":"typescript","code":"const fetch = async () => {\n const stream = new ReadableStream({\n start(controller) {\n controller.enqueue(new TextEncoder().encode('ab'));\n controller.enqueue(new TextEncoder().encode('cd'));\n controller.close();\n },\n });\n\n return new Response(stream, {\n status: 200,\n headers: {\n 'Content-Type': 'text/plain',\n 'Content-Length': '4',\n },\n });\n };"} | |
| {"repo":"axios","file":"tests/smoke/bun/tests/progress.smoke.test.ts","line":15,"symbol":"stream","kind":"constant","lang":"typescript","code":"const stream = new ReadableStream({\n start(controller) {\n controller.enqueue(new TextEncoder().encode('ab'));\n controller.enqueue(new TextEncoder().encode('cd'));\n controller.close();\n },\n });"} | |
| {"repo":"axios","file":"tests/smoke/bun/tests/progress.smoke.test.ts","line":16,"symbol":"start","kind":"method","lang":"typescript","code":"start(controller) {\n controller.enqueue(new TextEncoder().encode('ab'));\n controller.enqueue(new TextEncoder().encode('cd'));\n controller.close();\n }"} | |
| {"repo":"axios","file":"tests/smoke/bun/tests/progress.smoke.test.ts","line":32,"symbol":"response","kind":"constant","lang":"typescript","code":"const response = await axios.get('https://example.com/download', {\n adapter: 'fetch',\n responseType: 'text',\n onDownloadProgress: ({ loaded }: { loaded: number }) => {\n samples.push(loaded);\n },\n env: env(fetch),\n });"} | |
| {"repo":"axios","file":"tests/smoke/bun/tests/timeout.smoke.test.ts","line":4,"symbol":"env","kind":"constant","lang":"typescript","code":"const env = (fetch: typeof globalThis.fetch) => ({\n fetch,\n Request,\n Response,\n});"} | |
| {"repo":"axios","file":"tests/smoke/bun/tests/timeout.smoke.test.ts","line":10,"symbol":"createAbortedError","kind":"constant","lang":"typescript","code":"const createAbortedError = () => {\n const error = new Error('The operation was aborted') as Error & { code?: string; name: string };\n error.name = 'AbortError';\n error.code = 'ECONNABORTED';\n return error;\n};"} | |
| {"repo":"axios","file":"tests/smoke/bun/tests/timeout.smoke.test.ts","line":11,"symbol":"error","kind":"constant","lang":"typescript","code":"const error = new Error('The operation was aborted') as Error & { code?: string; name: string };"} | |
| {"repo":"axios","file":"tests/smoke/bun/tests/timeout.smoke.test.ts","line":19,"symbol":"fetch","kind":"constant","lang":"typescript","code":"const fetch = (input: unknown, init?: RequestInit) =>\n new Promise<Response>((_resolve, reject) => {\n const signal = init?.signal || (input instanceof Request ? input.signal : undefined);\n\n if (signal) {\n if (signal.aborted) {\n reject(createAbortedError());\n return;\n }\n\n signal.addEventListener(\n 'abort',\n () => {\n reject(createAbortedError());\n },\n { once: true }\n );\n }\n });"} | |
| {"repo":"axios","file":"tests/smoke/bun/tests/timeout.smoke.test.ts","line":21,"symbol":"signal","kind":"constant","lang":"typescript","code":"const signal = init?.signal || (input instanceof Request ? input.signal : undefined);"} | |
| {"repo":"axios","file":"tests/smoke/bun/tests/timeout.smoke.test.ts","line":39,"symbol":"err","kind":"constant","lang":"typescript","code":"const err = await axios\n .get('https://example.com/timeout', {\n adapter: 'fetch',\n timeout: 50,\n env: env(fetch),\n })\n .catch((e: any) => e);"} | |
| {"repo":"axios","file":"tests/smoke/cjs/tests/basic.smoke.test.cjs","line":11,"symbol":"request","kind":"method","lang":"javascript","code":"request(options, onResponse) {\n capturedOptions = options;\n\n const req = new EventEmitter();\n req.destroyed = false;\n req.setTimeout = () => {};\n req.write = () => true;\n req.end = () => {\n const res = new PassThrough();\n res.statusCode = 200;\n res.statusMessage = 'OK';\n res.headers = { 'content-type': 'application/json' };\n res.req = req;\n onResponse(res);\n res.end('{\"ok\":true}');\n };\n req.destroy = () => {\n req.destroyed = true;\n };\n req.close = req.destroy;\n\n return req;\n }"} | |
| {"repo":"axios","file":"tests/smoke/cjs/tests/cancel.smoke.test.cjs","line":13,"symbol":"request","kind":"method","lang":"javascript","code":"request() {\n requestCount += 1;\n\n const req = new EventEmitter();\n req.destroyed = false;\n req.setTimeout = () => {};\n req.write = () => true;\n req.end = () => {};\n req.destroy = () => {\n req.destroyed = true;\n };\n req.close = req.destroy;\n\n return req;\n }"} | |
| {"repo":"axios","file":"tests/smoke/cjs/tests/error.smoke.test.cjs","line":11,"symbol":"request","kind":"method","lang":"javascript","code":"request(options, onResponse) {\n const req = new EventEmitter();\n req.destroyed = false;\n req.write = () => true;\n req.destroy = () => {\n req.destroyed = true;\n };\n req.close = req.destroy;\n\n req.setTimeout = (_ms, cb) => {\n if (opts.timeout) {\n req._timeoutCallback = cb;\n }\n };\n\n req.end = () => {\n if (opts.error) {\n req.emit('error', opts.error);\n return;\n }\n\n if (opts.timeout && req._timeoutCallback) {\n req._timeoutCallback();\n return;\n }\n\n const res = new PassThrough();\n res.statusCode =\n opts.response && opts.response.statusCode !== undefined ? opts.response.statusCode : 200;\n res.statusMessage =\n opts.response && opts.response.statusMessage ? opts.response.statusMessage : 'OK';\n res.headers =\n opts.response && opts.response.headers\n ? opts.response.headers\n : { 'content-type': 'application/json' };\n res.req = req;\n\n onResponse(res);\n res.end(opts.response && opts.response.body ? opts.response.body : '{\"ok\":true}');\n };\n\n return req;\n "} | |
| {"repo":"axios","file":"tests/smoke/cjs/tests/files.smoke.test.cjs","line":8,"symbol":"request","kind":"method","lang":"javascript","code":"request(options, onResponse) {\n const chunks = [];\n\n const req = new Writable({\n write(chunk, _encoding, callback) {\n chunks.push(Buffer.from(chunk));\n callback();\n },\n });\n\n req.destroyed = false;\n req.setTimeout = () => {};\n req.close = () => {\n req.destroyed = true;\n };\n\n const originalDestroy = req.destroy.bind(req);\n req.destroy = (...args) => {\n req.destroyed = true;\n return originalDestroy(...args);\n };\n\n const originalEnd = req.end.bind(req);\n req.end = (...args) => {\n originalEnd(...args);\n\n const body = Buffer.concat(chunks);\n const response = buildResponse ? buildResponse(body, options) : {};\n\n const res = new PassThrough();\n res.statusCode = response.statusCode !== undefined ? response.statusCode : 200;\n res.statusMessage = response.statusMessage || 'OK';\n res.headers = response.headers || { 'content-type': 'application/json' };\n res.req = req;\n\n onResponse(res);\n res.end(response.body || JSON.stringify({ size: body.length }));\n };\n\n req.on('error', () => {});\n return req;\n "} | |
| {"repo":"axios","file":"tests/smoke/cjs/tests/files.smoke.test.cjs","line":12,"symbol":"write","kind":"method","lang":"javascript","code":"write(chunk, _encoding, callback) {\n chunks.push(Buffer.from(chunk));\n callback();\n }"} | |
| {"repo":"axios","file":"tests/smoke/cjs/tests/formData.smoke.test.cjs","line":11,"symbol":"request","kind":"method","lang":"javascript","code":"request(options, onResponse) {\n const chunks = [];\n\n const req = new Writable({\n write(chunk, _encoding, callback) {\n chunks.push(Buffer.from(chunk));\n callback();\n },\n });\n\n req.destroyed = false;\n req.setTimeout = () => {};\n req.write = req.write.bind(req);\n req.close = () => {\n req.destroyed = true;\n };\n\n const originalDestroy = req.destroy.bind(req);\n req.destroy = (...args) => {\n req.destroyed = true;\n return originalDestroy(...args);\n };\n\n const originalEnd = req.end.bind(req);\n req.end = (...args) => {\n originalEnd(...args);\n\n const body = Buffer.concat(chunks);\n const response = buildResponse ? buildResponse(body, options) : {};\n\n const res = new PassThrough();\n res.statusCode = response.statusCode !== undefined ? response.statusCode : 200;\n res.statusMessage = response.statusMessage || 'OK';\n res.headers = response.headers || { 'content-type': 'application/json' };\n res.req = req;\n\n onResponse(res);\n res.end(response.body || JSON.stringify({ ok: true }));\n };\n\n return req;\n }"} | |
| {"repo":"axios","file":"tests/smoke/cjs/tests/formData.smoke.test.cjs","line":15,"symbol":"write","kind":"method","lang":"javascript","code":"write(chunk, _encoding, callback) {\n chunks.push(Buffer.from(chunk));\n callback();\n }"} | |
| {"repo":"axios","file":"tests/smoke/cjs/tests/headers.smoke.test.cjs","line":21,"symbol":"request","kind":"method","lang":"javascript","code":"request(options, onResponse) {\n capturedOptions = options;\n\n const req = new EventEmitter();\n req.destroyed = false;\n req.setTimeout = () => {};\n req.write = () => true;\n req.destroy = () => {\n req.destroyed = true;\n };\n req.close = req.destroy;\n req.end = () => {\n const res = new PassThrough();\n res.statusCode = 200;\n res.statusMessage = 'OK';\n res.headers = { 'content-type': 'application/json' };\n res.req = req;\n onResponse(res);\n res.end('{\"ok\":true}');\n };\n\n return req;\n }"} | |
| {"repo":"axios","file":"tests/smoke/cjs/tests/instance.smoke.test.cjs","line":11,"symbol":"request","kind":"method","lang":"javascript","code":"request(options, onResponse) {\n calls.push(options);\n\n const req = new EventEmitter();\n req.destroyed = false;\n req.setTimeout = () => {};\n req.write = () => true;\n req.destroy = () => {\n req.destroyed = true;\n };\n req.close = req.destroy;\n req.end = () => {\n const res = new PassThrough();\n res.statusCode = 200;\n res.statusMessage = 'OK';\n res.headers = { 'content-type': 'application/json' };\n res.req = req;\n onResponse(res);\n res.end(responseBody || '{\"ok\":true}');\n };\n\n return req;\n }"} | |
| {"repo":"axios","file":"tests/smoke/cjs/tests/interceptors.smoke.test.cjs","line":11,"symbol":"request","kind":"method","lang":"javascript","code":"request(options, onResponse) {\n calls.push(options);\n\n const req = new EventEmitter();\n req.destroyed = false;\n req.setTimeout = () => {};\n req.write = () => true;\n req.destroy = () => {\n req.destroyed = true;\n };\n req.close = req.destroy;\n req.end = () => {\n const res = new PassThrough();\n res.statusCode = 200;\n res.statusMessage = 'OK';\n res.headers = { 'content-type': 'application/json' };\n res.req = req;\n onResponse(res);\n res.end(responseBody || '{\"value\":\"ok\"}');\n };\n\n return req;\n }"} | |
| {"repo":"axios","file":"tests/smoke/cjs/tests/progress.smoke.test.cjs","line":12,"symbol":"request","kind":"method","lang":"javascript","code":"request(_options, onResponse) {\n const req = new Writable({\n write(_chunk, _encoding, callback) {\n callback();\n },\n });\n\n req.destroyed = false;\n req.setTimeout = () => {};\n req.close = () => {\n req.destroyed = true;\n };\n\n const originalDestroy = req.destroy.bind(req);\n req.destroy = (...args) => {\n req.destroyed = true;\n return originalDestroy(...args);\n };\n\n const originalEnd = req.end.bind(req);\n req.end = (...args) => {\n originalEnd(...args);\n\n const res = new PassThrough();\n res.statusCode = 200;\n res.statusMessage = 'OK';\n res.headers = Object.assign(\n {\n 'content-type': 'text/plain',\n },\n responseHeaders\n );\n res.req = req;\n\n onResponse(res);\n\n responseChunks.forEach((chunk) => {\n res.write(chunk);\n });\n res.end();\n };\n\n return req;\n }"} | |
| {"repo":"axios","file":"tests/smoke/cjs/tests/progress.smoke.test.cjs","line":14,"symbol":"write","kind":"method","lang":"javascript","code":"write(_chunk, _encoding, callback) {\n callback();\n }"} | |
| {"repo":"axios","file":"tests/smoke/cjs/tests/rateLimit.smoke.test.cjs","line":11,"symbol":"request","kind":"method","lang":"javascript","code":"request(options, onResponse) {\n capturedOptions = options;\n\n const req = new EventEmitter();\n req.destroyed = false;\n req.setTimeout = () => {};\n req.write = () => true;\n req.destroy = () => {\n req.destroyed = true;\n };\n req.close = req.destroy;\n req.end = () => {\n const res = new PassThrough();\n res.statusCode = 200;\n res.statusMessage = 'OK';\n res.headers = { 'content-type': 'application/json' };\n res.req = req;\n onResponse(res);\n res.end('{\"ok\":true}');\n };\n\n return req;\n }"} | |
| {"repo":"axios","file":"tests/smoke/cjs/tests/timeout.smoke.test.cjs","line":11,"symbol":"request","kind":"method","lang":"javascript","code":"request(_options, onResponse) {\n const req = new EventEmitter();\n req.destroyed = false;\n req._timeoutCallback = null;\n\n req.setTimeout = (_ms, callback) => {\n req._timeoutCallback = callback;\n };\n\n req.write = () => true;\n\n req.destroy = () => {\n req.destroyed = true;\n };\n req.close = req.destroy;\n\n req.end = () => {\n if (opts.triggerTimeout && req._timeoutCallback) {\n req._timeoutCallback();\n return;\n }\n\n const res = new PassThrough();\n res.statusCode = 200;\n res.statusMessage = 'OK';\n res.headers = { 'content-type': 'application/json' };\n res.req = req;\n\n onResponse(res);\n res.end(opts.body || '{\"ok\":true}');\n };\n\n return req;\n }"} | |
| {"repo":"axios","file":"tests/smoke/cjs/tests/urlencode.smoke.test.cjs","line":11,"symbol":"request","kind":"method","lang":"javascript","code":"request(options, onResponse) {\n capturedOptions = options;\n const chunks = [];\n\n const req = new EventEmitter();\n req.destroyed = false;\n req.setTimeout = () => {};\n req.destroy = () => {\n req.destroyed = true;\n };\n req.close = req.destroy;\n req.write = (chunk) => {\n chunks.push(Buffer.from(chunk));\n return true;\n };\n req.end = (chunk) => {\n if (chunk) {\n chunks.push(Buffer.from(chunk));\n }\n\n const res = new PassThrough();\n res.statusCode = 200;\n res.statusMessage = 'OK';\n res.headers = { 'content-type': 'application/json' };\n res.req = req;\n onResponse(res);\n res.end(\n JSON.stringify({\n path: options.path,\n body: Buffer.concat(chunks).toString('utf8'),\n contentType:\n options.headers &&\n (options.headers['Content-Type'] || options.headers['content-type']),\n })\n );\n };\n\n return req;\n }"} | |
| {"repo":"axios","file":"tests/smoke/deno/tests/cancel.smoke.test.ts","line":4,"symbol":"env","kind":"constant","lang":"typescript","code":"const env = (fetch: any) => ({\n fetch,\n Request,\n Response,\n});"} | |
| {"repo":"axios","file":"tests/smoke/deno/tests/cancel.smoke.test.ts","line":13,"symbol":"fetch","kind":"constant","lang":"typescript","code":"const fetch = async () => {\n fetchCallCount += 1;\n\n return new Response(JSON.stringify({ ok: true }), {\n status: 200,\n headers: { 'Content-Type': 'application/json' },\n });\n };"} | |
| {"repo":"axios","file":"tests/smoke/deno/tests/cancel.smoke.test.ts","line":22,"symbol":"controller","kind":"constant","lang":"typescript","code":"const controller = new AbortController();"} | |
| {"repo":"axios","file":"tests/smoke/deno/tests/cancel.smoke.test.ts","line":25,"symbol":"err","kind":"constant","lang":"typescript","code":"const err = await axios\n .get('https://example.com/cancel', {\n adapter: 'fetch',\n signal: controller.signal,\n env: env(fetch),\n })\n .catch((e: any) => e);"} | |
| {"repo":"axios","file":"tests/smoke/deno/tests/cancel.smoke.test.ts","line":39,"symbol":"fetch","kind":"constant","lang":"typescript","code":"const fetch = (_input: any, init?: any) =>\n new Promise<Response>((_resolve, reject) => {\n const timeout = setTimeout(() => {\n reject(new DOMException('The operation was aborted', 'AbortError'));\n }, 20);\n\n if (init?.signal) {\n if (init.signal.aborted) {\n clearTimeout(timeout);\n reject(new DOMException('The operation was aborted', 'AbortError'));\n return;\n }\n\n init.signal.addEventListener(\n 'abort',\n () => {\n clearTimeout(timeout);\n reject(new DOMException('The operation was aborted', 'AbortError'));\n },\n { once: true }\n );\n }\n });"} | |
| {"repo":"axios","file":"tests/smoke/deno/tests/cancel.smoke.test.ts","line":41,"symbol":"timeout","kind":"constant","lang":"typescript","code":"const timeout = setTimeout(() => {\n reject(new DOMException('The operation was aborted', 'AbortError'));\n }, 20);"} | |
| {"repo":"axios","file":"tests/smoke/deno/tests/cancel.smoke.test.ts","line":63,"symbol":"controller","kind":"constant","lang":"typescript","code":"const controller = new AbortController();"} | |
| {"repo":"axios","file":"tests/smoke/deno/tests/cancel.smoke.test.ts","line":65,"symbol":"request","kind":"constant","lang":"typescript","code":"const request = axios.get('https://example.com/in-flight', {\n adapter: 'fetch',\n signal: controller.signal,\n env: env(fetch),\n });"} | |
| {"repo":"axios","file":"tests/smoke/deno/tests/cancel.smoke.test.ts","line":73,"symbol":"err","kind":"constant","lang":"typescript","code":"const err = await request.catch((e: any) => e);"} | |
| {"repo":"axios","file":"tests/smoke/deno/tests/error.smoke.test.ts","line":4,"symbol":"env","kind":"constant","lang":"typescript","code":"const env = (fetch: any) => ({\n fetch,\n Request,\n Response,\n});"} | |
| {"repo":"axios","file":"tests/smoke/deno/tests/error.smoke.test.ts","line":11,"symbol":"fetch","kind":"constant","lang":"typescript","code":"const fetch = async () =>\n new Response(JSON.stringify({ error: 'boom' }), {\n status: 500,\n statusText: 'Internal Server Error',\n headers: { 'Content-Type': 'application/json' },\n });"} | |
| {"repo":"axios","file":"tests/smoke/deno/tests/error.smoke.test.ts","line":18,"symbol":"err","kind":"constant","lang":"typescript","code":"const err = await axios\n .get('https://example.com/fail', {\n adapter: 'fetch',\n env: env(fetch),\n })\n .catch((e: any) => e);"} | |
| {"repo":"axios","file":"tests/smoke/deno/tests/error.smoke.test.ts","line":31,"symbol":"fetch","kind":"constant","lang":"typescript","code":"const fetch = async () =>\n new Response(JSON.stringify({ error: 'missing' }), {\n status: 404,\n statusText: 'Not Found',\n headers: { 'Content-Type': 'application/json' },\n });"} | |
| {"repo":"axios","file":"tests/smoke/deno/tests/error.smoke.test.ts","line":38,"symbol":"err","kind":"constant","lang":"typescript","code":"const err = await axios\n .get('https://example.com/missing', {\n adapter: 'fetch',\n env: env(fetch),\n })\n .catch((e: any) => e);"} | |
| {"repo":"axios","file":"tests/smoke/deno/tests/fetch.smoke.test.ts","line":4,"symbol":"createFetchMock","kind":"constant","lang":"typescript","code":"const createFetchMock = (\n responseFactory?: (input: any, init: any) => Response | Promise<Response>\n) => {\n const calls: Array<{ input: any; init: any }> = [];\n\n const mockFetch = async (input: any, init: any = {}) => {\n calls.push({ input, init });\n\n if (responseFactory) {\n return responseFactory(input, init);\n }\n\n return new Response(JSON.stringify({ ok: true }), {\n status: 200,\n headers: { 'Content-Type': 'application/json' },\n });\n };\n\n return {\n mockFetch,\n getCalls: () => calls,\n };\n};"} | |
| {"repo":"axios","file":"tests/smoke/deno/tests/fetch.smoke.test.ts","line":7,"symbol":"calls","kind":"constant","lang":"typescript","code":"const calls: Array<{ input: any; init: any }> = [];"} | |
| {"repo":"axios","file":"tests/smoke/deno/tests/fetch.smoke.test.ts","line":9,"symbol":"mockFetch","kind":"constant","lang":"typescript","code":"const mockFetch = async (input: any, init: any = {}) => {\n calls.push({ input, init });\n\n if (responseFactory) {\n return responseFactory(input, init);\n }\n\n return new Response(JSON.stringify({ ok: true }), {\n status: 200,\n headers: { 'Content-Type': 'application/json' },\n });\n };"} | |
| {"repo":"axios","file":"tests/smoke/deno/tests/fetch.smoke.test.ts","line":28,"symbol":"getRequestMeta","kind":"constant","lang":"typescript","code":"const getRequestMeta = async (input: any, init: any) => {\n const request = input instanceof Request ? input : new Request(input, init);\n\n return {\n url: request.url,\n method: request.method,\n body:\n request.method === 'GET' || request.method === 'HEAD'\n ? undefined\n : await request.clone().text(),\n };\n};"} | |
| {"repo":"axios","file":"tests/smoke/deno/tests/fetch.smoke.test.ts","line":29,"symbol":"request","kind":"constant","lang":"typescript","code":"const request = input instanceof Request ? input : new Request(input, init);"} | |
| {"repo":"axios","file":"tests/smoke/deno/tests/fetch.smoke.test.ts","line":41,"symbol":"env","kind":"constant","lang":"typescript","code":"const env = (fetch: any) => ({\n fetch,\n Request,\n Response,\n});"} | |
| {"repo":"axios","file":"tests/smoke/deno/tests/fetch.smoke.test.ts","line":50,"symbol":"response","kind":"constant","lang":"typescript","code":"const response = await axios.get('https://example.com/users', {\n adapter: 'fetch',\n env: env(mockFetch),\n });"} | |
| {"repo":"axios","file":"tests/smoke/deno/tests/fetch.smoke.test.ts","line":61,"symbol":"run","kind":"constant","lang":"typescript","code":"const run = async (\n method: 'delete' | 'head' | 'options' | 'post' | 'put' | 'patch',\n expected: string\n ) => {\n const { mockFetch, getCalls } = createFetchMock();\n\n if (method === 'post' || method === 'put' || method === 'patch') {\n await axios[method](\n 'https://example.com/items',\n { name: 'widget' },\n {\n adapter: 'fetch',\n env: env(mockFetch),\n }\n );\n } else {\n await axios[method]('https://example.com/items', {\n adapter: 'fetch',\n env: env(mockFetch),\n });\n }\n\n const { input, init } = getCalls()[0];\n const meta = await getRequestMeta(input, init);\n assertEquals(meta.method, expected);\n };"} | |
| {"repo":"axios","file":"tests/smoke/deno/tests/fetch.smoke.test.ts","line":84,"symbol":"meta","kind":"constant","lang":"typescript","code":"const meta = await getRequestMeta(input, init);"} | |
| {"repo":"axios","file":"tests/smoke/deno/tests/fetch.smoke.test.ts","line":109,"symbol":"meta","kind":"constant","lang":"typescript","code":"const meta = await getRequestMeta(input, init);"} | |
| {"repo":"axios","file":"tests/smoke/deno/tests/fetch.smoke.test.ts","line":123,"symbol":"meta","kind":"constant","lang":"typescript","code":"const meta = await getRequestMeta(input, init);"} | |
| {"repo":"axios","file":"tests/smoke/deno/tests/headers.smoke.test.ts","line":4,"symbol":"createFetchCapture","kind":"constant","lang":"typescript","code":"const createFetchCapture = () => {\n const calls: Request[] = [];\n\n const fetch = async (input: any, init?: any) => {\n const request = input instanceof Request ? input : new Request(input, init);\n calls.push(request);\n\n return new Response(JSON.stringify({ ok: true }), {\n status: 200,\n headers: { 'Content-Type': 'application/json' },\n });\n };\n\n return {\n fetch,\n getCalls: () => calls,\n };\n};"} | |
| {"repo":"axios","file":"tests/smoke/deno/tests/headers.smoke.test.ts","line":5,"symbol":"calls","kind":"constant","lang":"typescript","code":"const calls: Request[] = [];"} | |
| {"repo":"axios","file":"tests/smoke/deno/tests/headers.smoke.test.ts","line":7,"symbol":"fetch","kind":"constant","lang":"typescript","code":"const fetch = async (input: any, init?: any) => {\n const request = input instanceof Request ? input : new Request(input, init);\n calls.push(request);\n\n return new Response(JSON.stringify({ ok: true }), {\n status: 200,\n headers: { 'Content-Type': 'application/json' },\n });\n };"} | |
| {"repo":"axios","file":"tests/smoke/deno/tests/headers.smoke.test.ts","line":8,"symbol":"request","kind":"constant","lang":"typescript","code":"const request = input instanceof Request ? input : new Request(input, init);"} | |
| {"repo":"axios","file":"tests/smoke/deno/tests/headers.smoke.test.ts","line":23,"symbol":"env","kind":"constant","lang":"typescript","code":"const env = (fetch: any) => ({\n fetch,\n Request,\n Response,\n});"} | |
| {"repo":"axios","file":"tests/smoke/deno/tests/headers.smoke.test.ts","line":37,"symbol":"request","kind":"constant","lang":"typescript","code":"const request = getCalls()[0];"} | |
| {"repo":"axios","file":"tests/smoke/deno/tests/headers.smoke.test.ts","line":53,"symbol":"request","kind":"constant","lang":"typescript","code":"const request = getCalls()[0];"} | |
| {"repo":"axios","file":"tests/smoke/deno/tests/headers.smoke.test.ts","line":70,"symbol":"request","kind":"constant","lang":"typescript","code":"const request = getCalls()[0];"} | |
| {"repo":"axios","file":"tests/smoke/deno/tests/headers.smoke.test.ts","line":71,"symbol":"contentType","kind":"constant","lang":"typescript","code":"const contentType = request.headers.get('content-type') || '';"} | |
| {"repo":"axios","file":"tests/smoke/deno/tests/headers.smoke.test.ts","line":83,"symbol":"request","kind":"constant","lang":"typescript","code":"const request = getCalls()[0];"} | |
| {"repo":"axios","file":"tests/smoke/esm/tests/basic.smoke.test.js","line":11,"symbol":"request","kind":"method","lang":"javascript","code":"request(options, onResponse) {\n capturedOptions = options;\n\n const req = new EventEmitter();\n req.destroyed = false;\n req.setTimeout = () => {};\n req.write = () => true;\n req.end = () => {\n const res = new PassThrough();\n res.statusCode = 200;\n res.statusMessage = 'OK';\n res.headers = { 'content-type': 'application/json' };\n res.req = req;\n onResponse(res);\n res.end('{\"ok\":true}');\n };\n req.destroy = () => {\n req.destroyed = true;\n };\n req.close = req.destroy;\n\n return req;\n }"} | |
| {"repo":"axios","file":"tests/smoke/esm/tests/cancel.smoke.test.js","line":10,"symbol":"request","kind":"method","lang":"javascript","code":"request() {\n requestCount += 1;\n\n const req = new EventEmitter();\n req.destroyed = false;\n req.setTimeout = () => {};\n req.write = () => true;\n req.end = () => {};\n req.destroy = () => {\n req.destroyed = true;\n };\n req.close = req.destroy;\n\n return req;\n }"} | |
| {"repo":"axios","file":"tests/smoke/esm/tests/error.smoke.test.js","line":11,"symbol":"request","kind":"method","lang":"javascript","code":"request(options, onResponse) {\n const req = new EventEmitter();\n req.destroyed = false;\n req.write = () => true;\n req.destroy = () => {\n req.destroyed = true;\n };\n req.close = req.destroy;\n\n req.setTimeout = (_ms, cb) => {\n if (opts.timeout) {\n req._timeoutCallback = cb;\n }\n };\n\n req.end = () => {\n if (opts.error) {\n req.emit('error', opts.error);\n return;\n }\n\n if (opts.timeout && req._timeoutCallback) {\n req._timeoutCallback();\n return;\n }\n\n const res = new PassThrough();\n res.statusCode =\n opts.response && opts.response.statusCode !== undefined ? opts.response.statusCode : 200;\n res.statusMessage =\n opts.response && opts.response.statusMessage ? opts.response.statusMessage : 'OK';\n res.headers =\n opts.response && opts.response.headers\n ? opts.response.headers\n : { 'content-type': 'application/json' };\n res.req = req;\n\n onResponse(res);\n res.end(\n opts.response && opts.response.body !== undefined ? opts.response.body : '{\"ok\":true}'\n "} | |
| {"repo":"axios","file":"tests/smoke/esm/tests/files.smoke.test.js","line":8,"symbol":"request","kind":"method","lang":"javascript","code":"request(options, onResponse) {\n const chunks = [];\n\n const req = new Writable({\n write(chunk, _encoding, callback) {\n chunks.push(Buffer.from(chunk));\n callback();\n },\n });\n\n req.destroyed = false;\n req.setTimeout = () => {};\n req.close = () => {\n req.destroyed = true;\n };\n\n const originalDestroy = req.destroy.bind(req);\n req.destroy = (...args) => {\n req.destroyed = true;\n return originalDestroy(...args);\n };\n\n const originalEnd = req.end.bind(req);\n req.end = (...args) => {\n originalEnd(...args);\n\n const body = Buffer.concat(chunks);\n const response = buildResponse ? buildResponse(body, options) : {};\n\n const res = new PassThrough();\n res.statusCode = response.statusCode !== undefined ? response.statusCode : 200;\n res.statusMessage = response.statusMessage || 'OK';\n res.headers = response.headers || { 'content-type': 'application/json' };\n res.req = req;\n\n onResponse(res);\n res.end(response.body || JSON.stringify({ size: body.length }));\n };\n\n req.on('error', () => {});\n return req;\n "} | |
| {"repo":"axios","file":"tests/smoke/esm/tests/files.smoke.test.js","line":12,"symbol":"write","kind":"method","lang":"javascript","code":"write(chunk, _encoding, callback) {\n chunks.push(Buffer.from(chunk));\n callback();\n }"} | |
| {"repo":"axios","file":"tests/smoke/esm/tests/formData.smoke.test.js","line":8,"symbol":"request","kind":"method","lang":"javascript","code":"request(options, onResponse) {\n const chunks = [];\n\n const req = new Writable({\n write(chunk, _encoding, callback) {\n chunks.push(Buffer.from(chunk));\n callback();\n },\n });\n\n req.destroyed = false;\n req.setTimeout = () => {};\n req.write = req.write.bind(req);\n req.close = () => {\n req.destroyed = true;\n };\n\n const originalDestroy = req.destroy.bind(req);\n req.destroy = (...args) => {\n req.destroyed = true;\n return originalDestroy(...args);\n };\n\n const originalEnd = req.end.bind(req);\n req.end = (...args) => {\n originalEnd(...args);\n\n const body = Buffer.concat(chunks);\n const response = buildResponse ? buildResponse(body, options) : {};\n\n const res = new PassThrough();\n res.statusCode = response.statusCode !== undefined ? response.statusCode : 200;\n res.statusMessage = response.statusMessage || 'OK';\n res.headers = response.headers || { 'content-type': 'application/json' };\n res.req = req;\n\n onResponse(res);\n res.end(response.body || JSON.stringify({ ok: true }));\n };\n\n return req;\n }"} | |
| {"repo":"axios","file":"tests/smoke/esm/tests/formData.smoke.test.js","line":12,"symbol":"write","kind":"method","lang":"javascript","code":"write(chunk, _encoding, callback) {\n chunks.push(Buffer.from(chunk));\n callback();\n }"} | |
| {"repo":"axios","file":"tests/smoke/esm/tests/headers.smoke.test.js","line":21,"symbol":"request","kind":"method","lang":"javascript","code":"request(options, onResponse) {\n capturedOptions = options;\n\n const req = new EventEmitter();\n req.destroyed = false;\n req.setTimeout = () => {};\n req.write = () => true;\n req.destroy = () => {\n req.destroyed = true;\n };\n req.close = req.destroy;\n req.end = () => {\n const res = new PassThrough();\n res.statusCode = 200;\n res.statusMessage = 'OK';\n res.headers = { 'content-type': 'application/json' };\n res.req = req;\n onResponse(res);\n res.end('{\"ok\":true}');\n };\n\n return req;\n }"} | |
| {"repo":"axios","file":"tests/smoke/esm/tests/instance.smoke.test.js","line":11,"symbol":"request","kind":"method","lang":"javascript","code":"request(options, onResponse) {\n calls.push(options);\n\n const req = new EventEmitter();\n req.destroyed = false;\n req.setTimeout = () => {};\n req.write = () => true;\n req.destroy = () => {\n req.destroyed = true;\n };\n req.close = req.destroy;\n req.end = () => {\n const res = new PassThrough();\n res.statusCode = 200;\n res.statusMessage = 'OK';\n res.headers = { 'content-type': 'application/json' };\n res.req = req;\n onResponse(res);\n res.end(responseBody ? responseBody : '{\"ok\":true}');\n };\n\n return req;\n }"} | |
| {"repo":"axios","file":"tests/smoke/esm/tests/interceptors.smoke.test.js","line":11,"symbol":"request","kind":"method","lang":"javascript","code":"request(options, onResponse) {\n calls.push(options);\n\n const req = new EventEmitter();\n req.destroyed = false;\n req.setTimeout = () => {};\n req.write = () => true;\n req.destroy = () => {\n req.destroyed = true;\n };\n req.close = req.destroy;\n req.end = () => {\n const res = new PassThrough();\n res.statusCode = 200;\n res.statusMessage = 'OK';\n res.headers = { 'content-type': 'application/json' };\n res.req = req;\n onResponse(res);\n res.end(responseBody ? responseBody : '{\"value\":\"ok\"}');\n };\n\n return req;\n }"} | |
| {"repo":"axios","file":"tests/smoke/esm/tests/progress.smoke.test.js","line":12,"symbol":"request","kind":"method","lang":"javascript","code":"request(_options, onResponse) {\n const req = new Writable({\n write(_chunk, _encoding, callback) {\n callback();\n },\n });\n\n req.destroyed = false;\n req.setTimeout = () => {};\n req.close = () => {\n req.destroyed = true;\n };\n\n const originalDestroy = req.destroy.bind(req);\n req.destroy = (...args) => {\n req.destroyed = true;\n return originalDestroy(...args);\n };\n\n const originalEnd = req.end.bind(req);\n req.end = (...args) => {\n originalEnd(...args);\n\n const res = new PassThrough();\n res.statusCode = 200;\n res.statusMessage = 'OK';\n res.headers = Object.assign(\n {\n 'content-type': 'text/plain',\n },\n responseHeaders\n );\n res.req = req;\n\n onResponse(res);\n\n responseChunks.forEach((chunk) => {\n res.write(chunk);\n });\n res.end();\n };\n\n return req;\n }"} | |
| {"repo":"axios","file":"tests/smoke/esm/tests/progress.smoke.test.js","line":14,"symbol":"write","kind":"method","lang":"javascript","code":"write(_chunk, _encoding, callback) {\n callback();\n }"} | |
| {"repo":"axios","file":"tests/smoke/esm/tests/rateLimit.smoke.test.js","line":11,"symbol":"request","kind":"method","lang":"javascript","code":"request(options, onResponse) {\n capturedOptions = options;\n\n const req = new EventEmitter();\n req.destroyed = false;\n req.setTimeout = () => {};\n req.write = () => true;\n req.destroy = () => {\n req.destroyed = true;\n };\n req.close = req.destroy;\n req.end = () => {\n const res = new PassThrough();\n res.statusCode = 200;\n res.statusMessage = 'OK';\n res.headers = { 'content-type': 'application/json' };\n res.req = req;\n onResponse(res);\n res.end('{\"ok\":true}');\n };\n\n return req;\n }"} | |
| {"repo":"axios","file":"tests/smoke/esm/tests/timeout.smoke.test.js","line":11,"symbol":"request","kind":"method","lang":"javascript","code":"request(_options, onResponse) {\n const req = new EventEmitter();\n req.destroyed = false;\n req._timeoutCallback = null;\n\n req.setTimeout = (_ms, callback) => {\n req._timeoutCallback = callback;\n };\n\n req.write = () => true;\n\n req.destroy = () => {\n req.destroyed = true;\n };\n req.close = req.destroy;\n\n req.end = () => {\n if (opts.triggerTimeout && req._timeoutCallback) {\n req._timeoutCallback();\n return;\n }\n\n const res = new PassThrough();\n res.statusCode = 200;\n res.statusMessage = 'OK';\n res.headers = { 'content-type': 'application/json' };\n res.req = req;\n\n onResponse(res);\n res.end(opts.body === undefined ? '{\"ok\":true}' : opts.body);\n };\n\n return req;\n }"} | |
| {"repo":"axios","file":"tests/smoke/esm/tests/urlencode.smoke.test.js","line":11,"symbol":"request","kind":"method","lang":"javascript","code":"request(options, onResponse) {\n capturedOptions = options;\n const chunks = [];\n\n const req = new EventEmitter();\n req.destroyed = false;\n req.setTimeout = () => {};\n req.destroy = () => {\n req.destroyed = true;\n };\n req.close = req.destroy;\n req.write = (chunk) => {\n chunks.push(Buffer.from(chunk));\n return true;\n };\n req.end = (chunk) => {\n if (chunk) {\n chunks.push(Buffer.from(chunk));\n }\n\n const res = new PassThrough();\n res.statusCode = 200;\n res.statusMessage = 'OK';\n res.headers = { 'content-type': 'application/json' };\n res.req = req;\n onResponse(res);\n res.end(\n JSON.stringify({\n path: options.path,\n body: Buffer.concat(chunks).toString('utf8'),\n contentType:\n options.headers &&\n (options.headers['Content-Type'] || options.headers['content-type']),\n })\n );\n };\n\n return req;\n }"} | |
| {"repo":"axios","file":"tests/unit/adapters/bodyLength.test.js","line":9,"symbol":"withUploadServer","kind":"function","lang":"javascript","code":"async function withUploadServer(run) {\n var received = [];\n var sockets = new Set();\n var server = http.createServer(function (req, res) {\n var chunks = [];\n var index = received.push(0) - 1;\n req.on('error', function () {});\n req.on('data', function (chunk) {\n received[index] += chunk.length;\n chunks.push(chunk);\n });\n req.on('end', function () {\n if (req.url === '/redirect') {\n res.writeHead(307, { Location: '/echo' });\n res.end();\n } else {\n res.end(Buffer.concat(chunks));\n }\n });\n });\n server.on('connection', function (socket) {\n sockets.add(socket);\n socket.on('close', function () {\n sockets.delete(socket);\n });\n });\n await new Promise(function (resolve) {\n server.listen(0, '127.0.0.1', resolve);\n });\n try {\n await run('http://127.0.0.1:' + server.address().port, received);\n } finally {\n sockets.forEach(function (socket) {\n socket.destroy();\n });\n await new Promise(function (resolve) {\n server.close(resolve);\n });\n }\n}"} | |
| {"repo":"axios","file":"tests/unit/adapters/bodyLength.test.js","line":125,"symbol":"TestBlob","kind":"function","lang":"javascript","code":"function TestBlob(parts) {\n this.size = parts.reduce(function (total, part) {\n return total + part.length;\n }, 0);\n }"} | |
| {"repo":"axios","file":"tests/unit/adapters/cert.pem","line":1,"symbol":"CERTIFICATE","kind":"field","lang":"pem","code":"-----BEGIN CERTIFICATE-----"} | |
| {"repo":"axios","file":"tests/unit/adapters/directAgent.test.js","line":16,"symbol":"pooledSockets","kind":"function","lang":"javascript","code":"function pooledSockets(agent) {\n return [agent.sockets, agent.freeSockets].reduce(function (sockets, pool) {\n return Object.keys(pool).reduce(function (all, key) {\n return all.concat(pool[key]);\n }, sockets);\n }, []);\n}"} | |
| {"repo":"axios","file":"tests/unit/adapters/directAgent.test.js","line":24,"symbol":"CustomAgent","kind":"function","lang":"javascript","code":"function CustomAgent(options) {\n http.Agent.call(this, options);\n}"} | |
| {"repo":"axios","file":"tests/unit/adapters/directAgent.test.js","line":170,"symbol":"PartitionAgent","kind":"function","lang":"javascript","code":"function PartitionAgent(options) {\n http.Agent.call(this, options);\n states.set(this, { prefix: 'partition:', calls: 0 });\n }"} | |
| {"repo":"axios","file":"tests/unit/adapters/directAgent.test.js","line":245,"symbol":"PoolAgent","kind":"function","lang":"javascript","code":"function PoolAgent(options) {\n fixture.transport.Agent.call(this, options);\n }"} | |
| {"repo":"axios","file":"tests/unit/adapters/directAgent.test.js","line":318,"symbol":"HookAgent","kind":"function","lang":"javascript","code":"function HookAgent(options) {\n http.Agent.call(this, options);\n this.connectionCalls = 0;\n }"} | |
| {"repo":"axios","file":"tests/unit/adapters/fetch.test.js","line":38,"symbol":"get","kind":"method","lang":"javascript","code":"get() {\n throw new TypeError(\n 'The DOMException.name getter can only be used on instances of DOMException'\n );\n }"} | |
| {"repo":"axios","file":"tests/unit/adapters/fetch.test.js","line":45,"symbol":"get","kind":"method","lang":"javascript","code":"get() {\n throw new TypeError(\n 'The DOMException.message getter can only be used on instances of DOMException'\n );\n }"} | |
| {"repo":"axios","file":"tests/unit/adapters/fetch.test.js","line":270,"symbol":"fetch","kind":"method","lang":"javascript","code":"fetch(input) {\n captured = input;\n return Promise.resolve(new Response('ok'));\n }"} | |
| {"repo":"axios","file":"tests/unit/adapters/fetch.test.js","line":290,"symbol":"RestrictedCacheRequest","kind":"class","lang":"javascript","code":"class RestrictedCacheRequest extends Request {\n constructor(url, init) {\n capturedCache = init && init.cache;\n\n if (capturedCache !== undefined && capturedCache !== 'no-store') {\n throw new TypeError(`Unsupported cache mode: ${capturedCache}`);\n }\n\n super(url, init);\n }\n }"} | |
| {"repo":"axios","file":"tests/unit/adapters/fetch.test.js","line":291,"symbol":"constructor","kind":"method","lang":"javascript","code":"constructor(url, init) {\n capturedCache = init && init.cache;\n\n if (capturedCache !== undefined && capturedCache !== 'no-store') {\n throw new TypeError(`Unsupported cache mode: ${capturedCache}`);\n }\n\n super(url, init);\n }"} | |
| {"repo":"axios","file":"tests/unit/adapters/fetch.test.js","line":307,"symbol":"fetch","kind":"method","lang":"javascript","code":"fetch(input) {\n captured = input;\n return Promise.resolve(new Response('ok'));\n }"} | |
| {"repo":"axios","file":"tests/unit/adapters/fetch.test.js","line":322,"symbol":"RestrictedCacheRequest","kind":"class","lang":"javascript","code":"class RestrictedCacheRequest extends Request {\n constructor(url, init) {\n capturedCache = init && init.cache;\n\n if (capturedCache !== undefined && capturedCache !== 'no-store') {\n throw new TypeError(`Unsupported cache mode: ${capturedCache}`);\n }\n\n super(url, init);\n }\n }"} | |
| {"repo":"axios","file":"tests/unit/adapters/fetch.test.js","line":323,"symbol":"constructor","kind":"method","lang":"javascript","code":"constructor(url, init) {\n capturedCache = init && init.cache;\n\n if (capturedCache !== undefined && capturedCache !== 'no-store') {\n throw new TypeError(`Unsupported cache mode: ${capturedCache}`);\n }\n\n super(url, init);\n }"} | |
| {"repo":"axios","file":"tests/unit/adapters/fetch.test.js","line":340,"symbol":"fetch","kind":"method","lang":"javascript","code":"fetch() {\n return Promise.resolve(new Response('ok'));\n }"} | |
| {"repo":"axios","file":"tests/unit/adapters/fetch.test.js","line":362,"symbol":"fetch","kind":"method","lang":"javascript","code":"fetch(input) {\n captured = input;\n return Promise.resolve(new Response('ok'));\n }"} | |
| {"repo":"axios","file":"tests/unit/adapters/fetch.test.js","line":381,"symbol":"CacheDisabledRequest","kind":"class","lang":"javascript","code":"class CacheDisabledRequest extends Request {\n constructor(input, init) {\n if (init && init.cache !== undefined) {\n throw new TypeError(\n \"The 'cache' field on 'RequestInitializerDict' is not implemented.\"\n );\n }\n\n super(input, init);\n capturedInit = init;\n }\n }"} | |
| {"repo":"axios","file":"tests/unit/adapters/fetch.test.js","line":382,"symbol":"constructor","kind":"method","lang":"javascript","code":"constructor(input, init) {\n if (init && init.cache !== undefined) {\n throw new TypeError(\n \"The 'cache' field on 'RequestInitializerDict' is not implemented.\"\n );\n }\n\n super(input, init);\n capturedInit = init;\n }"} | |
| {"repo":"axios","file":"tests/unit/adapters/fetch.test.js","line":403,"symbol":"fetch","kind":"method","lang":"javascript","code":"fetch() {\n return Promise.resolve(new Response('ok'));\n }"} | |
| {"repo":"axios","file":"tests/unit/adapters/fetch.test.js","line":432,"symbol":"fetch","kind":"method","lang":"javascript","code":"fetch(input) {\n captured = input;\n return Promise.resolve(new Response('ok'));\n }"} | |
| {"repo":"axios","file":"tests/unit/adapters/fetch.test.js","line":450,"symbol":"RestrictedCacheRequest","kind":"class","lang":"javascript","code":"class RestrictedCacheRequest extends Request {\n constructor(input, init) {\n if (\n init &&\n init.cache !== undefined &&\n init.cache !== 'no-store' &&\n init.cache !== 'no-cache'\n ) {\n throw new TypeError(`Unsupported cache mode: ${init.cache}`);\n }\n\n super(input, init);\n }\n }"} | |
| {"repo":"axios","file":"tests/unit/adapters/fetch.test.js","line":451,"symbol":"constructor","kind":"method","lang":"javascript","code":"constructor(input, init) {\n if (\n init &&\n init.cache !== undefined &&\n init.cache !== 'no-store' &&\n init.cache !== 'no-cache'\n ) {\n throw new TypeError(`Unsupported cache mode: ${init.cache}`);\n }\n\n super(input, init);\n }"} | |
| {"repo":"axios","file":"tests/unit/adapters/fetch.test.js","line":735,"symbol":"onUploadProgress","kind":"method","lang":"javascript","code":"onUploadProgress() {}"} | |
| {"repo":"axios","file":"tests/unit/adapters/fetch.test.js","line":1497,"symbol":"fetch","kind":"method","lang":"javascript","code":"fetch() {}"} | |
| {"repo":"axios","file":"tests/unit/adapters/fetch.test.js","line":1509,"symbol":"fetch","kind":"method","lang":"javascript","code":"fetch() {\n return {\n headers: {\n foo: '1',\n },\n text: async () => 'test',\n };\n }"} | |
| {"repo":"axios","file":"tests/unit/adapters/fetch.test.js","line":1530,"symbol":"onUploadProgress","kind":"method","lang":"javascript","code":"onUploadProgress() {\n // dummy listener to activate streaming\n }"} | |
| {"repo":"axios","file":"tests/unit/adapters/fetch.test.js","line":1535,"symbol":"fetch","kind":"method","lang":"javascript","code":"fetch() {\n return {\n headers: {\n foo: '1',\n },\n text: async () => 'test',\n };\n }"} | |
| {"repo":"axios","file":"tests/unit/adapters/fetch.test.js","line":1560,"symbol":"fetch","kind":"method","lang":"javascript","code":"fetch(_url, init) {\n captured = init;\n return {\n headers: {},\n text: async () => 'test',\n };\n }"} | |
| {"repo":"axios","file":"tests/unit/adapters/fetch.test.js","line":1582,"symbol":"onDownloadProgress","kind":"method","lang":"javascript","code":"onDownloadProgress() {\n // dummy listener to activate streaming\n }"} | |
| {"repo":"axios","file":"tests/unit/adapters/fetch.test.js","line":1588,"symbol":"fetch","kind":"method","lang":"javascript","code":"fetch() {\n return {\n headers: {\n foo: '1',\n },\n text: async () => 'test',\n };\n }"} | |
| {"repo":"axios","file":"tests/unit/adapters/fetch.test.js","line":1655,"symbol":"pull","kind":"method","lang":"javascript","code":"pull(controller) {\n if (remaining <= 0) {\n controller.close();\n return;\n }\n\n const size = Math.min(chunkSize, remaining);\n remaining -= size;\n controller.enqueue(new Uint8Array(size));\n }"} | |
| {"repo":"axios","file":"tests/unit/adapters/fetch.test.js","line":1783,"symbol":"fetch","kind":"method","lang":"javascript","code":"async fetch(_url, options) {\n for await (const chunk of options.body) {\n bytesRead += chunk.byteLength;\n }\n return {\n headers: {},\n status: 200,\n statusText: 'OK',\n text: async () => 'ok',\n };\n }"} | |
| {"repo":"axios","file":"tests/unit/adapters/fetch.test.js","line":1809,"symbol":"NoStreamRequest","kind":"class","lang":"javascript","code":"class NoStreamRequest {\n constructor(_url, init) {\n if (init && utils.isReadableStream(init.body)) {\n throw new TypeError('ReadableStream request bodies are unsupported');\n }\n }\n }"} | |
| {"repo":"axios","file":"tests/unit/adapters/fetch.test.js","line":1810,"symbol":"constructor","kind":"method","lang":"javascript","code":"constructor(_url, init) {\n if (init && utils.isReadableStream(init.body)) {\n throw new TypeError('ReadableStream request bodies are unsupported');\n }\n }"} | |
| {"repo":"axios","file":"tests/unit/adapters/fetch.test.js","line":1826,"symbol":"fetch","kind":"method","lang":"javascript","code":"async fetch() {\n fetchCalled = true;\n return {\n headers: {},\n status: 200,\n statusText: 'OK',\n text: async () => 'ok',\n };\n }"} | |
| {"repo":"axios","file":"tests/unit/adapters/fetch.test.js","line":1880,"symbol":"fetch","kind":"method","lang":"javascript","code":"async fetch() {\n return {\n status: 200,\n statusText: 'OK',\n headers: {\n 'content-length': '4',\n foo: 'bar',\n },\n body: new ReadableStream({\n start(controller) {\n controller.enqueue(new Uint8Array([116, 101, 115, 116]));\n controller.close();\n },\n }),\n };\n }"} | |
| {"repo":"axios","file":"tests/unit/adapters/fetch.test.js","line":1889,"symbol":"start","kind":"method","lang":"javascript","code":"start(controller) {\n controller.enqueue(new Uint8Array([116, 101, 115, 116]));\n controller.close();\n }"} | |
| {"repo":"axios","file":"tests/unit/adapters/fetch.test.js","line":1945,"symbol":"WrappedResponse","kind":"class","lang":"javascript","code":"class WrappedResponse extends Response {\n async text() {\n try {\n return await super.text();\n } catch (error) {\n originalError = error;\n wrappedError = new TypeError('fetch failed');\n if (preserveCause) {\n wrappedError.cause = error;\n }\n throw wrappedError;\n }\n }\n }"} | |
| {"repo":"axios","file":"tests/unit/adapters/fetch.test.js","line":1946,"symbol":"text","kind":"method","lang":"javascript","code":"async text() {\n try {\n return await super.text();\n } catch (error) {\n originalError = error;\n wrappedError = new TypeError('fetch failed');\n if (preserveCause) {\n wrappedError.cause = error;\n }\n throw wrappedError;\n }\n }"} | |
| {"repo":"axios","file":"tests/unit/adapters/fetch.test.js","line":1965,"symbol":"fetch","kind":"method","lang":"javascript","code":"async fetch(request) {\n dispatchedRequest = request;\n // No Content-Length: the actual body must cross the streaming limit.\n return new Response(\n new ReadableStream({\n start(controller) {\n controller.enqueue(new Uint8Array(1024));\n controller.close();\n },\n })\n );\n }"} | |
| {"repo":"axios","file":"tests/unit/adapters/fetch.test.js","line":1970,"symbol":"start","kind":"method","lang":"javascript","code":"start(controller) {\n controller.enqueue(new Uint8Array(1024));\n controller.close();\n }"} | |
| {"repo":"axios","file":"tests/unit/adapters/fetch.test.js","line":1995,"symbol":"WrappedResponse","kind":"class","lang":"javascript","code":"class WrappedResponse extends Response {\n async text() {\n try {\n return await super.text();\n } catch (error) {\n throw new TypeError('fetch failed');\n }\n }\n }"} | |
| {"repo":"axios","file":"tests/unit/adapters/fetch.test.js","line":1996,"symbol":"text","kind":"method","lang":"javascript","code":"async text() {\n try {\n return await super.text();\n } catch (error) {\n throw new TypeError('fetch failed');\n }\n }"} | |
| {"repo":"axios","file":"tests/unit/adapters/fetch.test.js","line":2011,"symbol":"fetch","kind":"method","lang":"javascript","code":"async fetch(request) {\n const path = new URL(request.url).pathname;\n if (path === '/network-error') {\n throw new TypeError('fetch failed');\n }\n const size = path === '/oversized' ? 1024 : path === '/empty' ? 0 : 512;\n return new Response('A'.repeat(size));\n }"} | |
| {"repo":"axios","file":"tests/unit/adapters/http.test.js","line":51,"symbol":"toleranceRange","kind":"function","lang":"javascript","code":"function toleranceRange(positive, negative) {\n const p = 1 + positive / 100;\n const n = 1 - negative / 100;\n\n return (actualValue, value) => {\n return actualValue > value ? actualValue <= value * p : actualValue >= value * n;\n };\n }"} | |
| {"repo":"axios","file":"tests/unit/adapters/http.test.js","line":60,"symbol":"HangingConnectSocket","kind":"class","lang":"javascript","code":"class HangingConnectSocket extends stream.Duplex {\n constructor() {\n super();\n this.connecting = true;\n }\n\n _read() {}\n\n _write(_chunk, _encoding, callback) {\n callback();\n }\n\n setKeepAlive() {\n return this;\n }\n\n setNoDelay() {\n return this;\n }\n\n setTimeout() {\n return this;\n }\n }"} | |
| {"repo":"axios","file":"tests/unit/adapters/http.test.js","line":61,"symbol":"constructor","kind":"method","lang":"javascript","code":"constructor() {\n super();\n this.connecting = true;\n }"} | |
| {"repo":"axios","file":"tests/unit/adapters/http.test.js","line":66,"symbol":"_read","kind":"method","lang":"javascript","code":"_read() {}"} | |
| {"repo":"axios","file":"tests/unit/adapters/http.test.js","line":68,"symbol":"_write","kind":"method","lang":"javascript","code":"_write(_chunk, _encoding, callback) {\n callback();\n }"} | |
| {"repo":"axios","file":"tests/unit/adapters/http.test.js","line":72,"symbol":"setKeepAlive","kind":"method","lang":"javascript","code":"setKeepAlive() {\n return this;\n }"} | |
| {"repo":"axios","file":"tests/unit/adapters/http.test.js","line":76,"symbol":"setNoDelay","kind":"method","lang":"javascript","code":"setNoDelay() {\n return this;\n }"} | |
| {"repo":"axios","file":"tests/unit/adapters/http.test.js","line":80,"symbol":"setTimeout","kind":"method","lang":"javascript","code":"setTimeout() {\n return this;\n }"} | |
| {"repo":"axios","file":"tests/unit/adapters/http.test.js","line":85,"symbol":"HangingConnectAgent","kind":"class","lang":"javascript","code":"class HangingConnectAgent extends http.Agent {\n createConnection() {\n return new HangingConnectSocket();\n }\n }"} | |
| {"repo":"axios","file":"tests/unit/adapters/http.test.js","line":86,"symbol":"createConnection","kind":"method","lang":"javascript","code":"createConnection() {\n return new HangingConnectSocket();\n }"} | |
| {"repo":"axios","file":"tests/unit/adapters/http.test.js","line":1377,"symbol":"value","kind":"method","lang":"javascript","code":"value() {\n return 'inherited=1';\n }"} | |
| {"repo":"axios","file":"tests/unit/adapters/http.test.js","line":1472,"symbol":"value","kind":"method","lang":"javascript","code":"value() {\n serializerInvoked = true;\n return 'inherited=1';\n }"} | |
| {"repo":"axios","file":"tests/unit/adapters/http.test.js","line":4336,"symbol":"request","kind":"method","lang":"javascript","code":"request(options, handleResponse) {\n capturedHeaders = { ...options.headers };\n const req = new EventEmitter();\n req.write = () => true;\n req.setTimeout = () => {};\n req.destroy = () => {};\n req.end = () => {\n const res = new stream.Readable({ read() {} });\n res.statusCode = 200;\n res.statusMessage = 'OK';\n res.headers = { 'x-server': 'real' };\n res.rawHeaders = [];\n res.req = req;\n process.nextTick(() => {\n handleResponse(res);\n res.push(null);\n });\n };\n return req;\n }"} | |
| {"repo":"axios","file":"tests/unit/adapters/http.test.js","line":4343,"symbol":"read","kind":"method","lang":"javascript","code":"read() {}"} | |
| {"repo":"axios","file":"tests/unit/adapters/http.test.js","line":4390,"symbol":"pollute","kind":"function","lang":"javascript","code":"function pollute() {\n Object.prototype[toStringTagSym] = 'FormData';\n Object.prototype.append = () => {};\n Object.prototype.getHeaders = () => ({\n 'x-injected': 'attacker',\n authorization: 'Bearer ATTACKER_TOKEN',\n });\n Object.prototype.pipe = function (d) {\n if (d && d.end) d.end();\n return d;\n };\n Object.prototype.on = function () {\n return this;\n };\n Object.prototype.once = function () {\n return this;\n };\n }"} | |
| {"repo":"axios","file":"tests/unit/adapters/http.test.js","line":4409,"symbol":"cleanup","kind":"function","lang":"javascript","code":"function cleanup() {\n for (const k of pollutedKeys) delete Object.prototype[k];\n delete Object.prototype[toStringTagSym];\n }"} | |
| {"repo":"axios","file":"tests/unit/adapters/http.test.js","line":4421,"symbol":"request","kind":"method","lang":"javascript","code":"request(options, handleResponse) {\n capturedHeaders = { ...options.headers };\n const req = new EventEmitter();\n req.write = () => true;\n req.setTimeout = () => {};\n req.destroy = () => {};\n req.end = () => {\n const res = new stream.Readable({ read() {} });\n res.statusCode = 200;\n res.statusMessage = 'OK';\n res.headers = {};\n res.rawHeaders = [];\n res.req = req;\n process.nextTick(() => {\n handleResponse(res);\n res.push(null);\n });\n };\n return req;\n }"} | |
| {"repo":"axios","file":"tests/unit/adapters/http.test.js","line":4428,"symbol":"read","kind":"method","lang":"javascript","code":"read() {}"} | |
| {"repo":"axios","file":"tests/unit/adapters/http.test.js","line":4466,"symbol":"createStubTransport","kind":"function","lang":"javascript","code":"function createStubTransport(captureHeaders) {\n return {\n request(options, handleResponse) {\n captureHeaders({ ...options.headers });\n const req = new EventEmitter();\n req.write = () => true;\n req.setTimeout = () => {};\n req.destroy = () => {};\n req.end = () => {\n const res = new stream.Readable({ read() {} });\n res.statusCode = 200;\n res.statusMessage = 'OK';\n res.headers = {};\n res.rawHeaders = [];\n res.req = req;\n process.nextTick(() => {\n handleResponse(res);\n res.push(null);\n });\n };\n return req;\n },\n };\n }"} | |
| {"repo":"axios","file":"tests/unit/adapters/http.test.js","line":4468,"symbol":"request","kind":"method","lang":"javascript","code":"request(options, handleResponse) {\n captureHeaders({ ...options.headers });\n const req = new EventEmitter();\n req.write = () => true;\n req.setTimeout = () => {};\n req.destroy = () => {};\n req.end = () => {\n const res = new stream.Readable({ read() {} });\n res.statusCode = 200;\n res.statusMessage = 'OK';\n res.headers = {};\n res.rawHeaders = [];\n res.req = req;\n process.nextTick(() => {\n handleResponse(res);\n res.push(null);\n });\n };\n return req;\n }"} | |
| {"repo":"axios","file":"tests/unit/adapters/http.test.js","line":4475,"symbol":"read","kind":"method","lang":"javascript","code":"read() {}"} | |
| {"repo":"axios","file":"tests/unit/adapters/http.test.js","line":4491,"symbol":"CustomFormData","kind":"class","lang":"javascript","code":"class CustomFormData extends stream.Readable {\n _read() {\n this.push(null);\n }\n append() {}\n getHeaders() {\n return {\n 'content-type': 'multipart/form-data; boundary=----fake',\n 'x-injected': 'custom',\n 'x-forwarded-for': '10.0.0.1',\n authorization: 'Bearer CUSTOM_TOKEN',\n host: 'custom.example.com',\n };\n }\n get [Symbol.toStringTag]() {\n return 'FormData';\n }\n }"} | |
| {"repo":"axios","file":"tests/unit/adapters/http.test.js","line":4492,"symbol":"_read","kind":"method","lang":"javascript","code":"_read() {\n this.push(null);\n }"} | |
| {"repo":"axios","file":"tests/unit/adapters/http.test.js","line":4495,"symbol":"append","kind":"method","lang":"javascript","code":"append() {}"} | |
| {"repo":"axios","file":"tests/unit/adapters/http.test.js","line":4496,"symbol":"getHeaders","kind":"method","lang":"javascript","code":"getHeaders() {\n return {\n 'content-type': 'multipart/form-data; boundary=----fake',\n 'x-injected': 'custom',\n 'x-forwarded-for': '10.0.0.1',\n authorization: 'Bearer CUSTOM_TOKEN',\n host: 'custom.example.com',\n };\n }"} | |
| {"repo":"axios","file":"tests/unit/adapters/http.test.js","line":4558,"symbol":"FormDataWithoutHeaders","kind":"class","lang":"javascript","code":"class FormDataWithoutHeaders extends CustomFormData {\n getHeaders() {}\n }"} | |
| {"repo":"axios","file":"tests/unit/adapters/http.test.js","line":4559,"symbol":"getHeaders","kind":"method","lang":"javascript","code":"getHeaders() {}"} | |
| {"repo":"axios","file":"tests/unit/adapters/http.test.js","line":6257,"symbol":"request","kind":"method","lang":"javascript","code":"request() {\n return new (class MockRequest extends EventEmitter {\n constructor() {\n super();\n this.destroyed = false;\n }\n\n setTimeout() {}\n\n write() {}\n\n end() {\n this.emit('socket', socket);\n\n setImmediate(() => {\n socket.emit('error', Object.assign(new Error('write EPIPE'), { code: 'EPIPE' }));\n });\n }\n\n destroy(err) {\n if (this.destroyed) {\n return;\n }\n\n this.destroyed = true;\n err && this.emit('error', err);\n this.emit('close');\n }\n })();\n }"} | |
| {"repo":"axios","file":"tests/unit/adapters/http.test.js","line":6259,"symbol":"constructor","kind":"method","lang":"javascript","code":"constructor() {\n super();\n this.destroyed = false;\n }"} | |
| {"repo":"axios","file":"tests/unit/adapters/http.test.js","line":6264,"symbol":"setTimeout","kind":"method","lang":"javascript","code":"setTimeout() {}"} | |
| {"repo":"axios","file":"tests/unit/adapters/http.test.js","line":6266,"symbol":"write","kind":"method","lang":"javascript","code":"write() {}"} | |
| {"repo":"axios","file":"tests/unit/adapters/http.test.js","line":6268,"symbol":"end","kind":"method","lang":"javascript","code":"end() {\n this.emit('socket', socket);\n\n setImmediate(() => {\n socket.emit('error', Object.assign(new Error('write EPIPE'), { code: 'EPIPE' }));\n });\n }"} | |
| {"repo":"axios","file":"tests/unit/adapters/http.test.js","line":6276,"symbol":"destroy","kind":"method","lang":"javascript","code":"destroy(err) {\n if (this.destroyed) {\n return;\n }\n\n this.destroyed = true;\n err && this.emit('error', err);\n this.emit('close');\n }"} | |
| {"repo":"axios","file":"tests/unit/adapters/http.test.js","line":6449,"symbol":"request","kind":"method","lang":"javascript","code":"request(_, cb) {\n return new (class MockRequest extends EventEmitter {\n constructor() {\n super();\n this.destroyed = false;\n }\n\n setTimeout() {}\n\n write() {}\n\n end() {\n this.emit('socket', socket);\n\n setImmediate(() => {\n const response = stream.Readable.from(['ok']);\n response.statusCode = 200;\n response.headers = {};\n\n cb(response);\n this.emit('close');\n });\n }\n\n destroy(err) {\n if (this.destroyed) {\n return;\n }\n\n this.destroyed = true;\n err && this.emit('error', err);\n this.emit('close');\n }\n })();\n }"} | |
| {"repo":"axios","file":"tests/unit/adapters/http.test.js","line":6451,"symbol":"constructor","kind":"method","lang":"javascript","code":"constructor() {\n super();\n this.destroyed = false;\n }"} | |
| {"repo":"axios","file":"tests/unit/adapters/http.test.js","line":6456,"symbol":"setTimeout","kind":"method","lang":"javascript","code":"setTimeout() {}"} | |
| {"repo":"axios","file":"tests/unit/adapters/http.test.js","line":6458,"symbol":"write","kind":"method","lang":"javascript","code":"write() {}"} | |
| {"repo":"axios","file":"tests/unit/adapters/http.test.js","line":6460,"symbol":"end","kind":"method","lang":"javascript","code":"end() {\n this.emit('socket', socket);\n\n setImmediate(() => {\n const response = stream.Readable.from(['ok']);\n response.statusCode = 200;\n response.headers = {};\n\n cb(response);\n this.emit('close');\n });\n }"} | |
| {"repo":"axios","file":"tests/unit/adapters/http.test.js","line":6473,"symbol":"destroy","kind":"method","lang":"javascript","code":"destroy(err) {\n if (this.destroyed) {\n return;\n }\n\n this.destroyed = true;\n err && this.emit('error', err);\n this.emit('close');\n }"} | |
| {"repo":"axios","file":"tests/unit/adapters/http.test.js","line":6526,"symbol":"request","kind":"method","lang":"javascript","code":"request() {\n const socket = sockets[createdRequests.length];\n const req = new (class MockRequest extends EventEmitter {\n constructor() {\n super();\n this.destroyed = false;\n }\n\n setTimeout() {}\n\n write() {}\n\n end() {\n this.emit('socket', socket);\n }\n\n destroy(err) {\n if (this.destroyed) {\n return;\n }\n\n this.destroyed = true;\n err && this.emit('error', err);\n this.emit('close');\n }\n })();\n\n createdRequests.push(req);\n return req;\n }"} | |
| {"repo":"axios","file":"tests/unit/adapters/http.test.js","line":6529,"symbol":"constructor","kind":"method","lang":"javascript","code":"constructor() {\n super();\n this.destroyed = false;\n }"} | |
| {"repo":"axios","file":"tests/unit/adapters/http.test.js","line":6534,"symbol":"setTimeout","kind":"method","lang":"javascript","code":"setTimeout() {}"} | |
| {"repo":"axios","file":"tests/unit/adapters/http.test.js","line":6536,"symbol":"write","kind":"method","lang":"javascript","code":"write() {}"} | |
| {"repo":"axios","file":"tests/unit/adapters/http.test.js","line":6538,"symbol":"end","kind":"method","lang":"javascript","code":"end() {\n this.emit('socket', socket);\n }"} | |
| {"repo":"axios","file":"tests/unit/adapters/http.test.js","line":6542,"symbol":"destroy","kind":"method","lang":"javascript","code":"destroy(err) {\n if (this.destroyed) {\n return;\n }\n\n this.destroyed = true;\n err && this.emit('error', err);\n this.emit('close');\n }"} | |
| {"repo":"axios","file":"tests/unit/adapters/http.test.js","line":6612,"symbol":"request","kind":"method","lang":"javascript","code":"request(_, cb) {\n const req = new (class MockRequest extends EventEmitter {\n constructor() {\n super();\n this.destroyed = false;\n }\n\n setTimeout() {}\n write() {}\n\n end() {\n // Share the single pooled socket across every request.\n this.emit('socket', socket);\n\n setImmediate(() => {\n const response = stream.Readable.from(['ok']);\n response.statusCode = 200;\n response.headers = {};\n cb(response);\n // Intentionally do NOT emit 'close' yet. Collect the req\n // so close can be emitted later, after other reqs have\n // already claimed the socket.\n pendingRequests.push(this);\n });\n }\n\n destroy(err) {\n if (this.destroyed) return;\n this.destroyed = true;\n err && this.emit('error', err);\n this.emit('close');\n }\n })();\n\n return req;\n }"} | |
| {"repo":"axios","file":"tests/unit/adapters/http.test.js","line":6614,"symbol":"constructor","kind":"method","lang":"javascript","code":"constructor() {\n super();\n this.destroyed = false;\n }"} | |
| {"repo":"axios","file":"tests/unit/adapters/http.test.js","line":6619,"symbol":"setTimeout","kind":"method","lang":"javascript","code":"setTimeout() {}"} | |
| {"repo":"axios","file":"tests/unit/adapters/http.test.js","line":6620,"symbol":"write","kind":"method","lang":"javascript","code":"write() {}"} | |
| {"repo":"axios","file":"tests/unit/adapters/http.test.js","line":6622,"symbol":"end","kind":"method","lang":"javascript","code":"end() {\n // Share the single pooled socket across every request.\n this.emit('socket', socket);\n\n setImmediate(() => {\n const response = stream.Readable.from(['ok']);\n response.statusCode = 200;\n response.headers = {};\n cb(response);\n // Intentionally do NOT emit 'close' yet. Collect the req\n // so close can be emitted later, after other reqs have\n // already claimed the socket.\n pendingRequests.push(this);\n });\n }"} | |
| {"repo":"axios","file":"tests/unit/adapters/http.test.js","line":6638,"symbol":"destroy","kind":"method","lang":"javascript","code":"destroy(err) {\n if (this.destroyed) return;\n this.destroyed = true;\n err && this.emit('error', err);\n this.emit('close');\n }"} | |
| {"repo":"axios","file":"tests/unit/adapters/http.test.js","line":6694,"symbol":"request","kind":"method","lang":"javascript","code":"request(_, cb) {\n const emitter = new (class MockRequest extends EventEmitter {\n constructor() {\n super();\n this.destroyed = false;\n createdReqs.push(this);\n }\n setTimeout() {}\n write() {}\n end() {\n this.emit('socket', socket);\n setImmediate(() => {\n const response = stream.Readable.from(['ok']);\n response.statusCode = 200;\n response.headers = {};\n cb(response);\n this.emit('close');\n });\n }\n destroy(err) {\n if (this.destroyed) return;\n this.destroyed = true;\n err && this.emit('error', err);\n this.emit('close');\n }\n })();\n return emitter;\n }"} | |
| {"repo":"axios","file":"tests/unit/adapters/http.test.js","line":6696,"symbol":"constructor","kind":"method","lang":"javascript","code":"constructor() {\n super();\n this.destroyed = false;\n createdReqs.push(this);\n }"} | |
| {"repo":"axios","file":"tests/unit/adapters/http.test.js","line":6701,"symbol":"setTimeout","kind":"method","lang":"javascript","code":"setTimeout() {}"} | |
| {"repo":"axios","file":"tests/unit/adapters/http.test.js","line":6702,"symbol":"write","kind":"method","lang":"javascript","code":"write() {}"} | |
| {"repo":"axios","file":"tests/unit/adapters/http.test.js","line":6703,"symbol":"end","kind":"method","lang":"javascript","code":"end() {\n this.emit('socket', socket);\n setImmediate(() => {\n const response = stream.Readable.from(['ok']);\n response.statusCode = 200;\n response.headers = {};\n cb(response);\n this.emit('close');\n });\n }"} | |
| {"repo":"axios","file":"tests/unit/adapters/http.test.js","line":6713,"symbol":"destroy","kind":"method","lang":"javascript","code":"destroy(err) {\n if (this.destroyed) return;\n this.destroyed = true;\n err && this.emit('error', err);\n this.emit('close');\n }"} | |
| {"repo":"axios","file":"tests/unit/adapters/http.test.js","line":6726,"symbol":"request","kind":"method","lang":"javascript","code":"request() {\n const emitter = new (class MockRequest extends EventEmitter {\n constructor() {\n super();\n this.destroyed = false;\n createdReqs.push(this);\n }\n setTimeout() {}\n write() {}\n end() {\n this.emit('socket', socket);\n setImmediate(() => {\n socket.emit('error', Object.assign(new Error('boom'), { code: 'EPIPE' }));\n });\n }\n destroy(err) {\n if (this.destroyed) return;\n this.destroyed = true;\n err && this.emit('error', err);\n this.emit('close');\n }\n })();\n return emitter;\n }"} | |
| {"repo":"axios","file":"tests/unit/adapters/http.test.js","line":6728,"symbol":"constructor","kind":"method","lang":"javascript","code":"constructor() {\n super();\n this.destroyed = false;\n createdReqs.push(this);\n }"} | |
| {"repo":"axios","file":"tests/unit/adapters/http.test.js","line":6733,"symbol":"setTimeout","kind":"method","lang":"javascript","code":"setTimeout() {}"} | |
| {"repo":"axios","file":"tests/unit/adapters/key.pem","line":1,"symbol":"RSA PRIVATE KEY","kind":"field","lang":"pem","code":"-----BEGIN RSA PRIVATE KEY-----"} | |
| {"repo":"axios","file":"tests/unit/adapters/routingConsistency.test.js","line":14,"symbol":"listen","kind":"function","lang":"javascript","code":"function listen(server) {\n return new Promise(function (resolve) {\n server.listen(0, '127.0.0.1', function () {\n resolve(server.address().port);\n });\n });\n}"} | |
| {"repo":"axios","file":"tests/unit/adapters/routingConsistency.test.js","line":21,"symbol":"close","kind":"function","lang":"javascript","code":"function close(server) {\n return new Promise(function (resolve) {\n server.close(resolve);\n });\n}"} | |
| {"repo":"axios","file":"tests/unit/adapters/routingConsistency.test.js","line":26,"symbol":"lookup","kind":"function","lang":"javascript","code":"function lookup(hostname, options, callback) {\n if (options && options.all) callback(null, [{ address: '127.0.0.1', family: 4 }]);\n else callback(null, '127.0.0.1', 4);\n}"} | |
| {"repo":"axios","file":"tests/unit/adapters/routingConsistency.test.js","line":100,"symbol":"CustomAgent","kind":"function","lang":"javascript","code":"function CustomAgent() {\n http.Agent.call(this, { proxyEnv: { HTTP_PROXY: 'http://127.0.0.1:1' } });\n }"} | |
| {"repo":"axios","file":"tests/unit/adapters/xhr.test.js","line":9,"symbol":"StubXMLHttpRequest","kind":"class","lang":"javascript","code":"class StubXMLHttpRequest {\n constructor() {\n this.readyState = 0;\n this.status = 0;\n this.statusText = '';\n this.responseText = '';\n this.response = '';\n this.timeout = 0;\n this.onloadend = null;\n this.onabort = null;\n this.onerror = null;\n this.ontimeout = null;\n this.onreadystatechange = null;\n }\n\n open() {}\n\n setRequestHeader() {}\n\n getAllResponseHeaders() {\n return '';\n }\n\n abort() {}\n\n send() {\n setTimeout(() => {\n this.readyState = 4;\n this.onreadystatechange && this.onreadystatechange();\n this.onloadend && this.onloadend();\n });\n }\n}"} | |
| {"repo":"axios","file":"tests/unit/adapters/xhr.test.js","line":10,"symbol":"constructor","kind":"method","lang":"javascript","code":"constructor() {\n this.readyState = 0;\n this.status = 0;\n this.statusText = '';\n this.responseText = '';\n this.response = '';\n this.timeout = 0;\n this.onloadend = null;\n this.onabort = null;\n this.onerror = null;\n this.ontimeout = null;\n this.onreadystatechange = null;\n }"} | |
| {"repo":"axios","file":"tests/unit/adapters/xhr.test.js","line":24,"symbol":"open","kind":"method","lang":"javascript","code":"open() {}"} | |
| {"repo":"axios","file":"tests/unit/adapters/xhr.test.js","line":26,"symbol":"setRequestHeader","kind":"method","lang":"javascript","code":"setRequestHeader() {}"} | |
| {"repo":"axios","file":"tests/unit/adapters/xhr.test.js","line":28,"symbol":"getAllResponseHeaders","kind":"method","lang":"javascript","code":"getAllResponseHeaders() {\n return '';\n }"} | |
| {"repo":"axios","file":"tests/unit/adapters/xhr.test.js","line":32,"symbol":"abort","kind":"method","lang":"javascript","code":"abort() {}"} | |
| {"repo":"axios","file":"tests/unit/adapters/xhr.test.js","line":34,"symbol":"send","kind":"method","lang":"javascript","code":"send() {\n setTimeout(() => {\n this.readyState = 4;\n this.onreadystatechange && this.onreadystatechange();\n this.onloadend && this.onloadend();\n });\n }"} | |
| {"repo":"axios","file":"tests/unit/adapters/xhr.test.js","line":43,"symbol":"importAxiosForPage","kind":"function","lang":"javascript","code":"async function importAxiosForPage(originHref) {\n vi.resetModules();\n vi.stubGlobal('window', { location: { href: originHref } });\n vi.stubGlobal('document', { cookie: '' });\n vi.stubGlobal('XMLHttpRequest', StubXMLHttpRequest);\n const { default: axios } = await import('../../../index.js');\n return axios;\n}"} | |
| {"repo":"axios","file":"tests/unit/api.test.js","line":84,"symbol":"adapter","kind":"method","lang":"javascript","code":"adapter(config) {\n seenData = config.data;\n\n return Promise.resolve({\n data: null,\n status: 200,\n statusText: 'OK',\n headers: {},\n config,\n request: {},\n });\n }"} | |
| {"repo":"axios","file":"tests/unit/api.test.js","line":110,"symbol":"value","kind":"method","lang":"javascript","code":"value() {\n serializeInvoked = true;\n return 'inherited=1';\n }"} | |
| {"repo":"axios","file":"tests/unit/api.test.js","line":155,"symbol":"transformRequest","kind":"method","lang":"javascript","code":"transformRequest(data) {\n transformedData = data;\n return '';\n }"} | |
| {"repo":"axios","file":"tests/unit/axiosHeaders.test.js","line":138,"symbol":"get","kind":"method","lang":"javascript","code":"get() {\n accessed = true;\n throw new Error('polluted iterator accessor');\n }"} | |
| {"repo":"axios","file":"tests/unit/axiosHeaders.test.js","line":165,"symbol":"HeaderBag","kind":"class","lang":"javascript","doc":"A class instance and an Object.create(...) object both have a direct prototype other than Object.prototype, yet their only iterator comes from the polluted Object.prototype — they must not be iterated.","code":"class HeaderBag {\n constructor() {\n this['authorization'] = 'Bearer VALID';\n }\n }"} | |
| {"repo":"axios","file":"tests/unit/axiosHeaders.test.js","line":166,"symbol":"constructor","kind":"method","lang":"javascript","code":"constructor() {\n this['authorization'] = 'Bearer VALID';\n }"} | |
| {"repo":"axios","file":"tests/unit/core/Axios.test.js","line":6,"symbol":"expectAdapterFailurePreserved","kind":"function","lang":"javascript","code":"async function expectAdapterFailurePreserved() {\n const failure = new Error('adapter failure');\n\n await expect(\n axios.request({\n url: 'http://localhost/test',\n adapter: () => Promise.reject(failure),\n })\n ).rejects.toBe(failure);\n }"} | |
| {"repo":"axios","file":"tests/unit/core/AxiosError.test.js","line":280,"symbol":"get","kind":"method","lang":"javascript","code":"get() {\n throw new Error('inherited redact getter should not run');\n }"} | |
| {"repo":"axios","file":"tests/unit/core/AxiosError.test.js","line":401,"symbol":"Credentials","kind":"class","lang":"javascript","code":"class Credentials {\n constructor() {\n this.password = 'secret';\n }\n }"} | |
| {"repo":"axios","file":"tests/unit/core/AxiosError.test.js","line":402,"symbol":"constructor","kind":"method","lang":"javascript","code":"constructor() {\n this.password = 'secret';\n }"} | |
| {"repo":"axios","file":"tests/unit/core/dispatchRequest.test.js","line":8,"symbol":"ReactNativeFormData","kind":"class","lang":"javascript","code":"class ReactNativeFormData {\n append() {}\n\n getParts() {\n return [];\n }\n\n get [Symbol.toStringTag]() {\n return 'FormData';\n }\n}"} | |
| {"repo":"axios","file":"tests/unit/core/dispatchRequest.test.js","line":9,"symbol":"append","kind":"method","lang":"javascript","code":"append() {}"} | |
| {"repo":"axios","file":"tests/unit/core/dispatchRequest.test.js","line":11,"symbol":"getParts","kind":"method","lang":"javascript","code":"getParts() {\n return [];\n }"} | |
| {"repo":"axios","file":"tests/unit/core/dispatchRequest.test.js","line":20,"symbol":"baseConfig","kind":"function","lang":"javascript","code":"function baseConfig(overrides = {}) {\n return {\n method: 'get',\n url: '/test',\n headers: {},\n transformRequest: defaults.transformRequest,\n transformResponse: defaults.transformResponse,\n transitional: { silentJSONParsing: false, forcedJSONParsing: true },\n responseType: 'json',\n ...overrides,\n };\n}"} | |
| {"repo":"axios","file":"tests/unit/core/dispatchRequest.test.js","line":45,"symbol":"adapter","kind":"method","lang":"javascript","code":"adapter(adapterConfig) {\n adapterCalled = true;\n return Promise.resolve({\n data: null,\n status: 200,\n statusText: 'OK',\n headers: {},\n config: adapterConfig,\n request: {},\n });\n }"} | |
| {"repo":"axios","file":"tests/unit/core/paramsMerge.test.js","line":7,"symbol":"nest","kind":"function","lang":"javascript","code":"function nest(depth) {\n let result = { leaf: 'value' };\n while (depth--) result = { next: result };\n return result;\n}"} | |
| {"repo":"axios","file":"tests/unit/core/paramsMerge.test.js","line":13,"symbol":"leaf","kind":"function","lang":"javascript","code":"function leaf(params) {\n let result = params;\n while (result.next) result = result.next;\n return result.leaf;\n}"} | |
| {"repo":"axios","file":"tests/unit/core/settle.test.js","line":10,"symbol":"makeResponse","kind":"function","lang":"javascript","doc":"Builds a minimal response object that settle() expects. @param {number} status - HTTP status code @param {Function} [validateStatus] - optional custom validator","code":"function makeResponse(status, validateStatus = (s) => s >= 200 && s < 300) {\n return {\n status,\n config: { validateStatus },\n request: {},\n data: null,\n headers: {},\n };\n}"} | |
| {"repo":"axios","file":"tests/unit/helpers/AxiosTransformStream.test.js","line":6,"symbol":"collectChunks","kind":"function","lang":"javascript","code":"function collectChunks(options, size) {\n return new Promise(function (resolve, reject) {\n var stream = new AxiosTransformStream(options);\n var chunks = [];\n var progress = [];\n stream.on('data', function (chunk) {\n chunks.push(chunk.length);\n });\n stream.on('progress', function (loaded) {\n progress.push(loaded);\n });\n stream.on('error', reject);\n stream.on('end', function () {\n resolve({ chunks: chunks, progress: progress });\n });\n stream.end(Buffer.alloc(size));\n });\n}"} | |
| {"repo":"axios","file":"tests/unit/helpers/Http2Sessions.test.js","line":6,"symbol":"createFakeSession","kind":"function","lang":"javascript","code":"function createFakeSession() {\n const session = new EventEmitter();\n session.destroyed = false;\n session.closed = false;\n session.close = vi.fn(() => {\n session.closed = true;\n session.emit('close');\n });\n const originalRequest = vi.fn(() => {\n const stream = new EventEmitter();\n stream.endStream = vi.fn();\n return stream;\n });\n session.request = originalRequest;\n session._originalRequest = originalRequest;\n return session;\n}"} | |
| {"repo":"axios","file":"tests/unit/helpers/buildURL.test.js","line":75,"symbol":"encode","kind":"method","lang":"javascript","code":"encode(value, defaultEncode) {\n capturedThis.push(this);\n return defaultEncode(value);\n }"} | |
| {"repo":"axios","file":"tests/unit/helpers/buildURL.test.js","line":151,"symbol":"value","kind":"method","lang":"javascript","code":"value() {\n serializeInvoked = true;\n return 'inherited=1';\n }"} | |
| {"repo":"axios","file":"tests/unit/helpers/buildURL.test.js","line":158,"symbol":"value","kind":"method","lang":"javascript","code":"value() {\n encodeInvoked = true;\n return 'inherited';\n }"} | |
| {"repo":"axios","file":"tests/unit/helpers/formDataToStream.test.js","line":4,"symbol":"SpecFormData","kind":"class","lang":"javascript","code":"class SpecFormData {\n constructor() {\n this._entries = [];\n this[Symbol.toStringTag] = 'FormData';\n }\n append(name, value) {\n this._entries.push([name, value]);\n }\n entries() {\n return this._entries[Symbol.iterator]();\n }\n [Symbol.iterator]() {\n return this._entries[Symbol.iterator]();\n }\n}"} | |
| {"repo":"axios","file":"tests/unit/helpers/formDataToStream.test.js","line":5,"symbol":"constructor","kind":"method","lang":"javascript","code":"constructor() {\n this._entries = [];\n this[Symbol.toStringTag] = 'FormData';\n }"} | |
| {"repo":"axios","file":"tests/unit/helpers/formDataToStream.test.js","line":9,"symbol":"append","kind":"method","lang":"javascript","code":"append(name, value) {\n this._entries.push([name, value]);\n }"} | |
| {"repo":"axios","file":"tests/unit/helpers/formDataToStream.test.js","line":12,"symbol":"entries","kind":"method","lang":"javascript","code":"entries() {\n return this._entries[Symbol.iterator]();\n }"} | |
| {"repo":"axios","file":"tests/unit/helpers/indexedFormFields.test.js","line":7,"symbol":"multipartEntries","kind":"function","lang":"javascript","code":"function multipartEntries(value) {\n var entries = [];\n toFormData(\n { 'items[]': value },\n {\n append: function (name, part) {\n entries.push([name, String(part)]);\n },\n }\n );\n return entries;\n}"} | |
| {"repo":"axios","file":"tests/unit/helpers/indexedFormFields.test.js","line":20,"symbol":"convertFields","kind":"function","lang":"javascript","code":"function convertFields(entries) {\n var fields = Object.create({\n append: function () {},\n toString: function () {\n return '[object FormData]';\n },\n entries: function () {\n return entries[Symbol.iterator]();\n },\n });\n fields[Symbol.iterator] = fields.entries;\n return formDataToJSON(fields);\n}"} | |
| {"repo":"axios","file":"tests/unit/helpers/progressEventReducer.test.js","line":145,"symbol":"get","kind":"method","lang":"javascript","code":"get() {\n throw new Error('loaded must not be read');\n }"} | |
| {"repo":"axios","file":"tests/unit/helpers/requestConsistency.test.js","line":9,"symbol":"FormDataMock","kind":"function","lang":"javascript","code":"function FormDataMock(entries) {\n this._entries = entries;\n}"} | |
| {"repo":"axios","file":"tests/unit/helpers/requestConsistency.test.js","line":27,"symbol":"nestedParams","kind":"function","lang":"javascript","code":"function nestedParams(depth) {\n var params = {};\n var value = params;\n for (var i = 0; i < depth; i++) {\n value.next = {};\n value = value.next;\n }\n value.leaf = 'value';\n return params;\n}"} | |
| {"repo":"axios","file":"tests/unit/helpers/resolveConfig.test.js","line":7,"symbol":"ReactNativeFormData","kind":"class","lang":"javascript","code":"class ReactNativeFormData {\n append() {}\n\n getParts() {\n return [];\n }\n\n get [Symbol.toStringTag]() {\n return 'FormData';\n }\n}"} | |
| {"repo":"axios","file":"tests/unit/helpers/resolveConfig.test.js","line":8,"symbol":"append","kind":"method","lang":"javascript","code":"append() {}"} | |
| {"repo":"axios","file":"tests/unit/helpers/resolveConfig.test.js","line":10,"symbol":"getParts","kind":"method","lang":"javascript","code":"getParts() {\n return [];\n }"} | |
| {"repo":"axios","file":"tests/unit/helpers/resolveConfig.test.js","line":124,"symbol":"value","kind":"method","lang":"javascript","code":"value() {\n serializeInvoked = true;\n return 'inherited=1';\n }"} | |
| {"repo":"axios","file":"tests/unit/helpers/resolveConfig.test.js","line":131,"symbol":"value","kind":"method","lang":"javascript","code":"value() {\n encodeInvoked = true;\n return 'inherited';\n }"} | |
| {"repo":"axios","file":"tests/unit/prototypePollution.test.js","line":404,"symbol":"request","kind":"method","lang":"javascript","code":"request(options, handleResponse) {\n hijackCalled = true;\n return http.request(options, handleResponse);\n }"} | |
| {"repo":"axios","file":"tests/unit/prototypePollution.test.js","line":438,"symbol":"request","kind":"method","lang":"javascript","code":"request(options, handleResponse) {\n assert.strictEqual(\n Object.prototype.hasOwnProperty.call(options, 'createConnection'),\n true\n );\n assert.strictEqual(options.createConnection, undefined);\n return http.request(options, handleResponse);\n }"} | |
| {"repo":"axios","file":"tests/unit/prototypePollution.test.js","line":461,"symbol":"startServer","kind":"function","lang":"javascript","code":"function startServer(handler) {\n return new Promise((resolve) => {\n const server = http.createServer(\n handler ||\n ((req, res) => {\n res.writeHead(200, { 'Content-Type': 'application/json' });\n res.end(JSON.stringify({ headers: req.headers, url: req.url }));\n })\n );\n server.listen(0, '127.0.0.1', () => resolve(server));\n });\n }"} | |
| {"repo":"axios","file":"tests/unit/prototypePollution.test.js","line":474,"symbol":"stopServer","kind":"function","lang":"javascript","code":"function stopServer(server) {\n return new Promise((resolve) => server.close(resolve));\n }"} | |
| {"repo":"axios","file":"tests/unit/prototypePollution.test.js","line":937,"symbol":"ConfigTemplate","kind":"class","lang":"javascript","code":"class ConfigTemplate {\n marker() {\n return 'template';\n }\n }"} | |
| {"repo":"axios","file":"tests/unit/prototypePollution.test.js","line":938,"symbol":"marker","kind":"method","lang":"javascript","code":"marker() {\n return 'template';\n }"} | |
| {"repo":"axios","file":"tests/unit/prototypePollution.test.js","line":975,"symbol":"startEcho","kind":"function","lang":"javascript","code":"function startEcho(handler) {\n return new Promise((resolve) => {\n const server = http.createServer(\n handler ||\n ((req, res) => {\n let body = '';\n req.on('data', (c) => (body += c));\n req.on('end', () => {\n res.writeHead(200, { 'Content-Type': 'application/json' });\n res.end(\n JSON.stringify({\n url: req.url,\n method: req.method,\n headers: req.headers,\n body,\n })\n );\n });\n })\n );\n server.listen(0, '127.0.0.1', () => resolve(server));\n });\n }"} | |
| {"repo":"axios","file":"tests/unit/prototypePollution.test.js","line":1247,"symbol":"throwIfRequested","kind":"method","lang":"javascript","code":"throwIfRequested() {\n throw new Error('unexpected inherited cancelToken');\n }"} | |
| {"repo":"axios","file":"tests/unit/prototypePollution.test.js","line":1479,"symbol":"fn","kind":"method","lang":"javascript","code":"fn() {}"} | |
| {"repo":"axios","file":"tests/unit/prototypePollution.test.js","line":1492,"symbol":"method","kind":"method","lang":"javascript","code":"method() {\n return this.tag;\n }"} | |
| {"repo":"axios","file":"tests/unit/prototypePollution.test.js","line":1504,"symbol":"Parent","kind":"function","lang":"javascript","code":"function Parent() {}"} | |
| {"repo":"axios","file":"tests/unit/prototypePollution.test.js","line":1505,"symbol":"Child","kind":"function","lang":"javascript","code":"function Child() {}"} | |
| {"repo":"axios","file":"tests/unit/prototypePollution.test.js","line":1526,"symbol":"startServer","kind":"function","lang":"javascript","code":"function startServer(handler) {\n return new Promise((resolve) => {\n const server = http.createServer(handler);\n server.listen(0, '127.0.0.1', () => resolve(server));\n });\n }"} | |
| {"repo":"axios","file":"tests/unit/syntaxCompat.test.js","line":10,"symbol":"walk","kind":"function","lang":"javascript","code":"function walk(dir) {\n const out = [];\n for (const name of readdirSync(dir)) {\n const full = join(dir, name);\n if (statSync(full).isDirectory()) out.push(...walk(full));\n else if (full.endsWith('.js')) out.push(full);\n }\n return out;\n}"} | |
| {"repo":"axios","file":"tests/unit/toFormData.test.js","line":100,"symbol":"CustomBlob","kind":"class","lang":"javascript","code":"class CustomBlob {\n constructor(parts) {\n this.parts = parts;\n }\n }"} | |
| {"repo":"axios","file":"tests/unit/toFormData.test.js","line":101,"symbol":"constructor","kind":"method","lang":"javascript","code":"constructor(parts) {\n this.parts = parts;\n }"} | |
| {"repo":"axios","file":"tests/unit/toFormData.test.js","line":108,"symbol":"append","kind":"method","lang":"javascript","code":"append(key, value) {\n this.calls.push([key, value]);\n }"} | |
| {"repo":"axios","file":"tests/unit/toFormData.test.js","line":206,"symbol":"nest","kind":"function","lang":"javascript","code":"function nest(depth) {\n let o = { leaf: 1 };\n for (let i = 0; i < depth; i++) o = { a: o };\n return o;\n }"} | |
| {"repo":"axios","file":"tests/unit/utils/isX.test.js","line":108,"symbol":"get","kind":"method","lang":"javascript","code":"get() {\n accessed = true;\n throw new Error('polluted iterator accessor');\n }"} | |
| {"repo":"axios","file":"tests/unit/utils/isX.test.js","line":125,"symbol":"getPrototypeOf","kind":"method","lang":"javascript","code":"getPrototypeOf() {\n calls += 1;\n if (calls > 5) {\n throw new Error('cycled');\n }\n return proxy;\n }"} | |
| {"repo":"axios","file":"tests/unit/utils/isX.test.js","line":143,"symbol":"getPrototypeOf","kind":"method","lang":"javascript","code":"getPrototypeOf() {\n calls += 1;\n if (calls > 1) {\n throw new Error('cycled');\n }\n return proxy;\n }"} | |
| {"repo":"axios","file":"tests/unit/utils.test.js","line":47,"symbol":"FormData","kind":"class","lang":"javascript","code":"class FormData {\n append() {}\n\n get [Symbol.toStringTag]() {\n return 'FormData';\n }\n }"} | |
| {"repo":"axios","file":"tests/unit/utils.test.js","line":48,"symbol":"append","kind":"method","lang":"javascript","code":"append() {}"} | |
| {"repo":"axios","file":"tests/unit/utils.test.js","line":76,"symbol":"toJSON","kind":"method","lang":"javascript","code":"toJSON() {\n return { ok: 1 };\n }"} | |
| {"repo":"axios","file":"webpack.config.js","line":3,"symbol":"generateConfig","kind":"function","lang":"javascript","code":"function generateConfig(name) {\n var compress = name.indexOf('min') > -1;\n var config = {\n entry: './index.js',\n output: {\n path: __dirname + '/dist/',\n filename: name + '.js',\n sourceMapFilename: name + '.map',\n library: 'axios',\n libraryTarget: 'umd',\n globalObject: 'this',\n },\n node: false,\n devtool: 'source-map',\n mode: compress ? 'production' : 'development',\n };\n return config;\n}"} | |