You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: index.d.ts
+78Lines changed: 78 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -409,3 +409,81 @@ export function stringifyUrl(
409
409
object: UrlObject,
410
410
options?: StringifyOptions
411
411
): string;
412
+
413
+
/**
414
+
Pick query parameters from a URL.
415
+
416
+
@param url - The URL containing the query parameters to pick.
417
+
@param keys - The names of the query parameters to keep. All other query parameters will be removed from the URL.
418
+
@param filter - A filter predicate that will be provided the name of each query parameter and its value. The `parseNumbers` and `parseBooleans` options also affect `value`.
419
+
420
+
@returns The URL with the picked query parameters.
Exclude query parameters from a URL. Like `.pick()` but reversed.
454
+
455
+
@param url - The URL containing the query parameters to exclude.
456
+
@param keys - The names of the query parameters to remove. All other query parameters will remain in the URL.
457
+
@param filter - A filter predicate that will be provided the name of each query parameter and its value. The `parseNumbers` and `parseBooleans` options also affect `value`.
458
+
459
+
@returns The URL without the excluded the query parameters.
The URL containing the query parameters to filter.
457
+
458
+
#### keys
459
+
460
+
Type: `string[]`
461
+
462
+
The names of the query parameters to filter based on the function used.
463
+
464
+
#### filter
465
+
466
+
Type: `(key, value) => boolean`
467
+
468
+
A filter predicate that will be provided the name of each query parameter and its value. The `parseNumbers` and `parseBooleans` options also affect `value`.
469
+
470
+
#### options
471
+
472
+
Type: `object`
473
+
474
+
[Parse options](#options) and [stringify options](#options-1).
475
+
418
476
## Nesting
419
477
420
478
This module intentionally doesn't support nesting as it's not spec'd and varies between implementations, which causes a lot of [edge cases](https://github.com/visionmedia/node-querystring/issues).
0 commit comments