Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

parse-domain

Package Overview
Dependencies
Maintainers
8
Versions
55
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

parse-domain - npm Package Compare versions

Comparing version 2.1.0 to 2.1.1

10

CHANGELOG.md

@@ -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)

2

lib/parseDomain.js

@@ -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: "",

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc