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 3.0.1 to 3.1.0

9

index.js

@@ -13,2 +13,3 @@ 'use strict';

normalizeHttps: false,
normalizeHttp: false,
stripFragment: true,

@@ -34,2 +35,10 @@ stripWWW: true,

if (opts.normalizeHttps && opts.normalizeHttp) {
throw new Error('The `normalizeHttp` and `normalizeHttps` options cannot be used together');
}
if (opts.normalizeHttp && urlObj.protocol === 'http:') {
urlObj.protocol = 'https:';
}
if (opts.normalizeHttps && urlObj.protocol === 'https:') {

@@ -36,0 +45,0 @@ urlObj.protocol = 'http:';

2

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

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

@@ -72,2 +72,19 @@ # normalize-url [![Build Status](https://travis-ci.org/sindresorhus/normalize-url.svg?branch=master)](https://travis-ci.org/sindresorhus/normalize-url)

##### normalizeHttp
Type: `boolean`<br>
Default: `false`
Normalize `http:` URLs to `https:`.
```js
normalizeUrl('https://sindresorhus.com:80/');
//=> 'https://sindresorhus.com'
normalizeUrl('http://sindresorhus.com:80/', {normalizeHttp: true});
//=> 'https://sindresorhus.com'
```
This option is mutually exclusive with the `normalizeHttps` option.
##### stripFragment

@@ -74,0 +91,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