Skip to content

Commit

Permalink
feat: replace qs node API with URLSearchParams web api
Browse files Browse the repository at this point in the history
  • Loading branch information
t-col committed Jul 3, 2024
1 parent 706d7b6 commit 8020f4e
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 20 deletions.
31 changes: 15 additions & 16 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,7 @@
"fast-copy": "^2.1.7",
"lodash.isplainobject": "^4.0.6",
"lodash.isstring": "^4.0.1",
"p-throttle": "^4.1.1",
"qs": "^6.11.2"
"p-throttle": "^4.1.1"
},
"devDependencies": {
"@babel/cli": "^7.12.8",
Expand Down
4 changes: 2 additions & 2 deletions src/create-http-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { AxiosRequestHeaders } from 'axios'
import type { AxiosStatic } from 'axios'
import copy from 'fast-copy'
import asyncToken from './async-token'
import qs from 'qs'

import rateLimitRetry from './rate-limit'
import rateLimitThrottle from './rate-limit-throttle'
Expand Down Expand Up @@ -97,9 +96,10 @@ export default function createHttpClient(
maxBodyLength: config.maxBodyLength,
paramsSerializer: {
serialize: (params) => {
return qs.stringify(params)
return params ? new URLSearchParams(params).toString() : ''
},
},

// Contentful
logHandler: config.logHandler,
responseLogger: config.responseLogger,
Expand Down

0 comments on commit 8020f4e

Please sign in to comment.