Skip to content

Commit

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

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

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@
"fast-copy": "^2.1.7",
"lodash.isplainobject": "^4.0.6",
"lodash.isstring": "^4.0.1",
"p-throttle": "^4.1.1"
"p-throttle": "^4.1.1",
"qs": "^6.11.2"
},
"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,6 +2,7 @@ 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 @@ -96,10 +97,9 @@ export default function createHttpClient(
maxBodyLength: config.maxBodyLength,
paramsSerializer: {
serialize: (params) => {
return params ? new URLSearchParams(params).toString() : ''
return qs.stringify(params)
},
},

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

0 comments on commit 8119699

Please sign in to comment.