Socket
Socket
Sign inDemoInstall

normalize-url

Package Overview
Dependencies
0
Maintainers
2
Versions
52
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 6.0.1 to 6.1.0

20

index.d.ts

@@ -158,4 +158,22 @@ declare namespace normalizeUrl {

```
If a boolean is provided, `true` will remove all the query parameters.
```
normalizeUrl('www.sindresorhus.com?foo=bar', {
removeQueryParameters: true
});
//=> 'http://sindresorhus.com'
```
`false` will not remove any query parameter.
```
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>;
readonly removeQueryParameters?: ReadonlyArray<RegExp | string> | boolean;

@@ -162,0 +180,0 @@ /**

@@ -176,2 +176,6 @@ 'use strict';

if (options.removeQueryParameters === true) {
urlObj.search = '';
}
// Sort query parameters

@@ -178,0 +182,0 @@ if (options.sortQueryParameters) {

2

package.json
{
"name": "normalize-url",
"version": "6.0.1",
"version": "6.1.0",
"description": "Normalize a URL",

@@ -5,0 +5,0 @@ "license": "MIT",

@@ -178,3 +178,3 @@ # normalize-url [![Coverage Status](https://codecov.io/gh/sindresorhus/normalize-url/branch/main/graph/badge.svg)](https://codecov.io/gh/sindresorhus/normalize-url)

Type: `Array<RegExp | string>`\
Type: `Array<RegExp | string> | boolean`\
Default: `[/^utm_\w+/i]`

@@ -191,2 +191,20 @@

If a boolean is provided, `true` will remove all the query parameters.
```js
normalizeUrl('www.sindresorhus.com?foo=bar', {
removeQueryParameters: true
});
//=> 'http://sindresorhus.com'
```
`false` will not remove any query parameter.
```js
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'
```
##### removeTrailingSlash

@@ -193,0 +211,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc