Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: export mergeConfig #5151

Merged
merged 2 commits into from Dec 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 4 additions & 2 deletions index.js
Expand Up @@ -16,7 +16,8 @@ const {
spread,
toFormData,
AxiosHeaders,
formToJSON
formToJSON,
mergeConfig
} = axios;

export {
Expand All @@ -33,5 +34,6 @@ export {
spread,
toFormData,
AxiosHeaders,
formToJSON
formToJSON,
mergeConfig
}
3 changes: 3 additions & 0 deletions lib/axios.js
Expand Up @@ -70,6 +70,9 @@ axios.spread = spread;
// Expose isAxiosError
axios.isAxiosError = isAxiosError;

// Expose mergeConfig
axios.mergeConfig = mergeConfig;

axios.AxiosHeaders = AxiosHeaders;

axios.formToJSON = thing => formDataToJSON(utils.isHTMLForm(thing) ? new FormData(thing) : thing);
Expand Down
4 changes: 4 additions & 0 deletions test/specs/api.spec.js
Expand Up @@ -50,6 +50,10 @@ describe('static api', function () {
it('should have isAxiosError properties', function () {
expect(typeof axios.isAxiosError).toEqual('function');
});

it('should have mergeConfig properties', function () {
expect(typeof axios.mergeConfig).toEqual('function');
});
});

describe('instance api', function () {
Expand Down
1 change: 1 addition & 0 deletions test/specs/instance.spec.js
Expand Up @@ -23,6 +23,7 @@ describe('instance', function () {
'spread',
'getUri',
'isAxiosError',
'mergeConfig',
'VERSION',
'default',
'toFormData',
Expand Down