Skip to content

Commit d8bcbb8

Browse files
authored
Merge pull request #484 from contentful/feat/replace-node-apis
feat: replace qs node API with URLSearchParams web api
2 parents 706d7b6 + 8020f4e commit d8bcbb8

File tree

3 files changed

+18
-20
lines changed

3 files changed

+18
-20
lines changed

package-lock.json

Lines changed: 15 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,7 @@
5151
"fast-copy": "^2.1.7",
5252
"lodash.isplainobject": "^4.0.6",
5353
"lodash.isstring": "^4.0.1",
54-
"p-throttle": "^4.1.1",
55-
"qs": "^6.11.2"
54+
"p-throttle": "^4.1.1"
5655
},
5756
"devDependencies": {
5857
"@babel/cli": "^7.12.8",

src/create-http-client.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { AxiosRequestHeaders } from 'axios'
22
import type { AxiosStatic } from 'axios'
33
import copy from 'fast-copy'
44
import asyncToken from './async-token'
5-
import qs from 'qs'
65

76
import rateLimitRetry from './rate-limit'
87
import rateLimitThrottle from './rate-limit-throttle'
@@ -97,9 +96,10 @@ export default function createHttpClient(
9796
maxBodyLength: config.maxBodyLength,
9897
paramsSerializer: {
9998
serialize: (params) => {
100-
return qs.stringify(params)
99+
return params ? new URLSearchParams(params).toString() : ''
101100
},
102101
},
102+
103103
// Contentful
104104
logHandler: config.logHandler,
105105
responseLogger: config.responseLogger,

0 commit comments

Comments
 (0)