Skip to content

Commit 7beddc1

Browse files
renovate[bot]scaleway-botchambo-e
authored
fix(deps): update dependency query-string to v8 (#1136)
* fix(deps): update dependency query-string to v8 * Add changeset renovate-e233d4c * fix: update usage --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Scaleway Bot <[email protected]> Co-authored-by: Emmanuel Chambon <[email protected]>
1 parent d026e9e commit 7beddc1

File tree

5 files changed

+32
-27
lines changed

5 files changed

+32
-27
lines changed

.changeset/renovate-e233d4c.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@scaleway/use-query-params': patch
3+
---
4+
5+
Updated dependency `query-string` to `8.1.0`.

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,9 @@
117117
"text",
118118
"cobertura"
119119
],
120+
"transformIgnorePatterns": [
121+
"node_modules/(?!(.*(query-string|decode-uri-component|split-on-first|filter-obj)))"
122+
],
120123
"reporters": [
121124
"default",
122125
[

packages/use-query-params/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"license": "MIT",
3131
"dependencies": {
3232
"history": "5.3.0",
33-
"query-string": "7.1.3"
33+
"query-string": "8.1.0"
3434
},
3535
"peerDependencies": {
3636
"react": "18.x || 18",

packages/use-query-params/src/index.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { parse, stringify } from 'query-string'
1+
import queryString from 'query-string'
22
import { useCallback, useMemo } from 'react'
33
import { useLocation, useNavigate } from 'react-router-dom'
44

@@ -7,6 +7,9 @@ type Options = {
77
push: boolean
88
}
99

10+
const {parse} = queryString
11+
const {stringify} = queryString
12+
1013
type QueryParamValue = string | number | boolean | null | undefined
1114

1215
type QueryParams = {
@@ -35,7 +38,7 @@ const useQueryParams = <T extends QueryParams>(): {
3538

3639
const currentState = useMemo(
3740
() =>
38-
parse(location.search, {
41+
queryString.parse(location.search, {
3942
arrayFormat: 'comma',
4043
parseBooleans: true,
4144
parseNumbers: true,
@@ -45,7 +48,7 @@ const useQueryParams = <T extends QueryParams>(): {
4548

4649
const stringyFormat = useCallback(
4750
(params: Partial<T>): string =>
48-
stringify(params, {
51+
queryString.stringify(params, {
4952
arrayFormat: 'comma',
5053
skipEmptyString: true,
5154
skipNull: true,

pnpm-lock.yaml

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

0 commit comments

Comments
 (0)