Socket
Socket
Sign inDemoInstall

tldts-core

Package Overview
Dependencies
Maintainers
1
Versions
713
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tldts-core - npm Package Compare versions

Comparing version 5.3.2 to 5.4.0

dist/es6/src/domain-without-suffix.js

18

dist/cjs/index.js

@@ -80,2 +80,14 @@ 'use strict';

/**
* Return the part of domain without suffix.
*
* Example: for domain 'foo.com', the result would be 'foo'.
*/
function getDomainWithoutSuffix(domain, suffix) {
// Note: here `domain` and `suffix` cannot have the same length because in
// this case we set `domain` to `null` instead. It is thus safe to assume
// that `suffix` is shorter than `domain`.
return domain.slice(0, -suffix.length - 1);
}
/**
* @param url - URL we want to extract a hostname from.

@@ -376,2 +388,3 @@ * @param urlIsValidHostname - hint from caller; true if `url` is already a valid hostname.

domain: null,
domainWithoutSuffix: null,
hostname: null,

@@ -439,2 +452,7 @@ isIcann: null,

result.subdomain = getSubdomain(result.hostname, result.domain);
if (step === 4 /* SUB_DOMAIN */) {
return result;
}
// Extract domain without suffix
result.domainWithoutSuffix = getDomainWithoutSuffix(result.domain, result.publicSuffix);
return result;

@@ -441,0 +459,0 @@ }

@@ -7,2 +7,3 @@ /**

import getDomain from './domain';
import getDomainWithoutSuffix from './domain-without-suffix';
import extractHostname from './extract-hostname';

@@ -17,2 +18,3 @@ import isIp from './is-ip';

domain: null,
domainWithoutSuffix: null,
hostname: null,

@@ -80,4 +82,9 @@ isIcann: null,

result.subdomain = getSubdomain(result.hostname, result.domain);
if (step === 4 /* SUB_DOMAIN */) {
return result;
}
// Extract domain without suffix
result.domainWithoutSuffix = getDomainWithoutSuffix(result.domain, result.publicSuffix);
return result;
}
//# sourceMappingURL=factory.js.map

1

dist/types/src/factory.d.ts

@@ -14,2 +14,3 @@ /**

publicSuffix: string | null;
domainWithoutSuffix: string | null;
isIcann: boolean | null;

@@ -16,0 +17,0 @@ isPrivate: boolean | null;

15

package.json
{
"name": "tldts-core",
"version": "5.3.2",
"version": "5.4.0",
"description": "tldts core primitives (internal module)",
"author": "Rémi Berson",
"author": {
"name": "Rémi Berson"
},
"contributors": [

@@ -24,2 +26,5 @@ "Alexei <alexeiatyahoodotcom@gmail.com>",

],
"publishConfig": {
"access": "public"
},
"license": "MIT",

@@ -32,3 +37,3 @@ "homepage": "https://github.com/remusao/tldts#readme",

"type": "git",
"url": "git@github.com:remusao/tldts.git"
"url": "git+ssh://git@github.com/remusao/tldts.git"
},

@@ -54,3 +59,3 @@ "main": "dist/cjs/index.js",

"jest": "^24.8.0",
"rimraf": "^2.6.3",
"rimraf": "^3.0.0",
"rollup": "^1.17.0",

@@ -64,3 +69,3 @@ "rollup-plugin-node-resolve": "^5.2.0",

},
"gitHead": "29ad399169551d4c2a8eb366d7d73354b1b17a3e"
"gitHead": "84504d72570559f42ebf23647437b5ea0ff53d73"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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