feat: export mergeConfig (#5151)

Co-authored-by: Jay <jasonsaayman@gmail.com>
This commit is contained in:
Kevin Ennis 2022-12-01 13:41:57 -05:00 committed by GitHub
parent 6f59cdbac9
commit 26874603b3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 12 additions and 2 deletions

View File

@ -16,7 +16,8 @@ const {
spread,
toFormData,
AxiosHeaders,
formToJSON
formToJSON,
mergeConfig
} = axios;
export {
@ -33,5 +34,6 @@ export {
spread,
toFormData,
AxiosHeaders,
formToJSON
formToJSON,
mergeConfig
}

View File

@ -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);

View File

@ -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 () {

View File

@ -23,6 +23,7 @@ describe('instance', function () {
'spread',
'getUri',
'isAxiosError',
'mergeConfig',
'VERSION',
'default',
'toFormData',