Skip to content

Commit

Permalink
style: clean code
Browse files Browse the repository at this point in the history
  • Loading branch information
haoziqaq committed Nov 30, 2023
1 parent 76b5fb5 commit 20c7d3d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
22 changes: 11 additions & 11 deletions src/interceptors/requestHeadersInterceptor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@ export function requestHeadersInterceptor(options: RequestHeadersInterceptorOpti
const { headers: headersOrGetter } = options

return {
onFulfilled(config) {
const headers = (isFunction(headersOrGetter) ? headersOrGetter() : headersOrGetter) ?? {}
onFulfilled(config) {
const headers = (isFunction(headersOrGetter) ? headersOrGetter() : headersOrGetter) ?? {}

Object.entries(headers).forEach(([key, value]) => {
config.headers[key] = value
})

Object.entries(headers).forEach(([key, value]) => {
config.headers[key] = value
})

return config
},
onRejected(error) {
return Promise.reject(error)
}
}
},
onRejected(error) {
return Promise.reject(error)
},
}
}
2 changes: 1 addition & 1 deletion src/interceptors/responseBlobInterceptor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export function responseBlobInterceptor(options: ResponseBlobInterceptorOptions
return options.data?.(response) ?? response
}

return response
return response
},
onRejected(error) {
return Promise.reject(error)
Expand Down

0 comments on commit 20c7d3d

Please sign in to comment.