2
0
mirror of https://github.com/tenrok/axios.git synced 2026-06-17 19:21:29 +03:00

fix(index): add create to index exports (#6460)

Co-authored-by: Felippe Leitao Nacif <felippe.nacif@olxbr.com>
This commit is contained in:
Felippe Nacif
2026-04-27 10:28:46 -03:00
committed by GitHub
parent 25387ae1ce
commit bef4868caf
3 changed files with 10 additions and 1 deletions
Vendored
+2
View File
@@ -724,6 +724,8 @@ export function mergeConfig<D = any>(
config2: AxiosRequestConfig<D>
): AxiosRequestConfig<D>;
export function create(config?: CreateAxiosDefaults): AxiosInstance;
export interface AxiosStatic extends AxiosInstance {
Cancel: CancelStatic;
CancelToken: CancelTokenStatic;
+2
View File
@@ -20,10 +20,12 @@ const {
formToJSON,
getAdapter,
mergeConfig,
create,
} = axios;
export {
axios as default,
create,
Axios,
AxiosError,
CanceledError,
+6 -1
View File
@@ -1,6 +1,6 @@
import { describe, it } from 'vitest';
import assert from 'assert';
import axios from '../../index.js';
import axios, { create } from '../../index.js';
describe('static api', () => {
it('should have request method helpers', () => {
@@ -53,6 +53,11 @@ describe('static api', () => {
assert.strictEqual(typeof axios.create, 'function');
});
it('should expose create as a named export', () => {
assert.strictEqual(typeof create, 'function');
assert.strictEqual(create, axios.create);
});
it('should have CanceledError, CancelToken, and isCancel properties', () => {
assert.strictEqual(typeof axios.Cancel, 'function');
assert.strictEqual(typeof axios.CancelToken, 'function');