Skip to content

Commit

Permalink
chore: Sync readme and index.d.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonJang committed Jun 21, 2021
1 parent 8035d21 commit 91d66e8
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ declare namespace normalizeUrl {
readonly stripWWW?: boolean;

/**
Removes query parameters that matches any of the provided strings or regexes.
Removes query parameters that matches any of the provided strings or regexes. If a boolean is provided, `true` will remove all the query parameters. `false` will not remove any query parameter.
@default [/^utm_\w+/i]
Expand All @@ -154,6 +154,16 @@ declare namespace normalizeUrl {
removeQueryParameters: ['ref']
});
//=> 'http://sindresorhus.com/?foo=bar'
normalizeUrl('www.sindresorhus.com?foo=bar', {
removeQueryParameters: true
});
//=> 'http://sindresorhus.com'
normalizeUrl('www.sindresorhus.com?foo=bar&utm_medium=test&ref=test_ref', {
removeQueryParameters: false
});
//=> 'http://www.sindresorhus.com/?foo=bar&ref=test_ref&utm_medium=test'
```
*/
readonly removeQueryParameters?: ReadonlyArray<RegExp | string> | boolean;
Expand Down

0 comments on commit 91d66e8

Please sign in to comment.