normalize-url
Advanced tools
Comparing version 1.8.0 to 1.9.0
@@ -38,2 +38,3 @@ 'use strict'; | ||
normalizeProtocol: true, | ||
normalizeHttps: false, | ||
stripFragment: true, | ||
@@ -57,2 +58,6 @@ stripWWW: true, | ||
if (opts.normalizeHttps && urlObj.protocol === 'https:') { | ||
urlObj.protocol = 'http:'; | ||
} | ||
if (!urlObj.hostname && !urlObj.pathname) { | ||
@@ -59,0 +64,0 @@ throw new Error('Invalid URL'); |
{ | ||
"name": "normalize-url", | ||
"version": "1.8.0", | ||
"version": "1.9.0", | ||
"description": "Normalize a URL", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -55,2 +55,17 @@ # normalize-url [![Build Status](https://travis-ci.org/sindresorhus/normalize-url.svg?branch=master)](https://travis-ci.org/sindresorhus/normalize-url) | ||
##### normalizeHttps | ||
Type: `boolean`<br> | ||
Default: `false` | ||
Normalize `https:` URLs to `http:`. | ||
```js | ||
normalizeUrl('https://sindresorhus.com:80/'); | ||
//=> 'https://sindresorhus.com' | ||
normalizeUrl('https://sindresorhus.com:80/', {normalizeHttps: true}); | ||
//=> 'http://sindresorhus.com' | ||
``` | ||
##### stripFragment | ||
@@ -57,0 +72,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
9273
130
157