parse-domain
Advanced tools
Comparing version 2.1.0 to 2.1.1
@@ -5,2 +5,12 @@ # Change Log | ||
<a name="2.1.1"></a> | ||
## [2.1.1](https://github.com/peerigon/parse-domain/compare/v2.1.0...v2.1.1) (2018-05-30) | ||
### Bug Fixes | ||
* Support url which has no protocol ([#28](https://github.com/peerigon/parse-domain/issues/28)) ([74dec41](https://github.com/peerigon/parse-domain/commit/74dec41)) | ||
<a name="2.1.0"></a> | ||
@@ -7,0 +17,0 @@ # [2.1.0](https://github.com/peerigon/parse-domain/compare/v2.0.0...v2.1.0) (2018-05-30) |
@@ -8,3 +8,3 @@ "use strict"; | ||
const urlParts = /^(https?:\/\/)?([^/]*@)?(.+?)(:\d{2,5})?([/?].*)?$/; // 1 = protocol, 2 = auth, 3 = domain, 4 = port, 5 = path | ||
const urlParts = /^(:?\/\/|https?:\/\/)?([^/]*@)?(.+?)(:\d{2,5})?([/?].*)?$/; // 1 = protocol, 2 = auth, 3 = domain, 4 = port, 5 = path | ||
const dot = /\./g; | ||
@@ -11,0 +11,0 @@ const emptyArr = []; |
{ | ||
"name": "parse-domain", | ||
"version": "2.1.0", | ||
"version": "2.1.1", | ||
"description": "Splits an url into sub-domain, domain and effective top-level-domain", | ||
@@ -10,2 +10,3 @@ "main": "./lib/parseDomain.js", | ||
"postinstall": "node scripts/build-tries.js", | ||
"prepare": "node scripts/write-pre.js", | ||
"release": "standard-version" | ||
@@ -12,0 +13,0 @@ }, |
@@ -17,2 +17,7 @@ "use strict"; | ||
}); | ||
expect(parseDomain("//example.com")).to.eql({ | ||
subdomain: "", | ||
domain: "example", | ||
tld: "com", | ||
}); | ||
expect(parseDomain("https://example.com")).to.eql({ | ||
@@ -19,0 +24,0 @@ subdomain: "", |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
614342
1071
1