Skip to content

Commit

Permalink
feat: export mergeConfig
Browse files Browse the repository at this point in the history
  • Loading branch information
kevincennis committed Dec 1, 2022
1 parent e1a4efe commit 6e8b68b
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
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

0 comments on commit 6e8b68b

Please sign in to comment.