Comparing version 5.3.2 to 5.4.0
@@ -18,2 +18,5 @@ import { parseImpl } from 'tldts-core'; | ||
} | ||
export function getDomainWithoutSuffix(url, options) { | ||
return parseImpl(url, 5 /* ALL */, suffixLookup, options).domainWithoutSuffix; | ||
} | ||
//# sourceMappingURL=index.js.map |
@@ -7,1 +7,2 @@ import { IOptions, IResult } from 'tldts-core'; | ||
export declare function getHostname(url: string, options?: Partial<IOptions>): string | null; | ||
export declare function getDomainWithoutSuffix(url: string, options?: Partial<IOptions>): string | null; |
{ | ||
"name": "tldts", | ||
"version": "5.3.2", | ||
"version": "5.4.0", | ||
"description": "Library to work against complex domain names, subdomains and URIs.", | ||
"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" | ||
}, | ||
@@ -58,7 +63,7 @@ "main": "dist/cjs/index.js", | ||
"jest": "^24.8.0", | ||
"rimraf": "^2.6.3", | ||
"rimraf": "^3.0.0", | ||
"rollup": "^1.17.0", | ||
"rollup-plugin-node-resolve": "^5.2.0", | ||
"rollup-plugin-sourcemaps": "^0.4.2", | ||
"tldts-tests": "^5.3.2", | ||
"tldts-tests": "^5.4.0", | ||
"ts-jest": "^24.0.2", | ||
@@ -70,3 +75,3 @@ "tslint": "^5.18.0", | ||
"dependencies": { | ||
"tldts-core": "^5.3.2" | ||
"tldts-core": "^5.4.0" | ||
}, | ||
@@ -88,3 +93,3 @@ "keywords": [ | ||
], | ||
"gitHead": "29ad399169551d4c2a8eb366d7d73354b1b17a3e" | ||
"gitHead": "84504d72570559f42ebf23647437b5ea0ff53d73" | ||
} |
@@ -29,2 +29,3 @@ # tldts - Blazing Fast URL Parsing | ||
"domain": "writethedocs.org", | ||
"domainWithoutSuffix": "writethedocs", | ||
"hostname": "www.writethedocs.org", | ||
@@ -46,2 +47,3 @@ "isIcann": true, | ||
// { domain: 'writethedocs.org', | ||
// domainWithoutSuffix: 'writethedocs', | ||
// hostname: 'www.writethedocs.org', | ||
@@ -70,2 +72,3 @@ // isIcann: true, | ||
* `tldts.getSubdomain(url, | hostname, options)` | ||
* `tldts.getDomainWithoutSuffix(url | hostname, options)` | ||
@@ -109,2 +112,3 @@ The behavior of `tldts` can be customized using an `options` argument for all | ||
// { domain: 'amazonaws.com', | ||
// domainWithoutSuffix: 'amazonaws', | ||
// hostname: 'spark-public.s3.amazonaws.com', | ||
@@ -119,2 +123,3 @@ // isIcann: true, | ||
// { domain: 'spark-public.s3.amazonaws.com', | ||
// domainWithoutSuffix: 'spark-public', | ||
// hostname: 'spark-public.s3.amazonaws.com', | ||
@@ -129,2 +134,3 @@ // isIcann: false, | ||
// { domain: 'domain.unknown', | ||
// domainWithoutSuffix: 'domain', | ||
// hostname: 'domain.unknown', | ||
@@ -139,2 +145,3 @@ // isIcann: false, | ||
// { domain: null, | ||
// domainWithoutSuffix: null, | ||
// hostname: '192.168.0.0', | ||
@@ -149,2 +156,3 @@ // isIcann: null, | ||
// { domain: null, | ||
// domainWithoutSuffix: null, | ||
// hostname: '::1', | ||
@@ -159,2 +167,3 @@ // isIcann: null, | ||
// { domain: 'emailprovider.co.uk', | ||
// domainWithoutSuffix: 'emailprovider', | ||
// hostname: 'emailprovider.co.uk', | ||
@@ -168,11 +177,12 @@ // isIcann: true, | ||
| Property Name | Type | Description | | ||
|:-------------- |:------ |:------------------------------------------- | | ||
| `hostname` | `str` | `hostname` of the input extracted automatically | | ||
| `domain` | `str` | Domain (tld + sld) | | ||
| `subdomain` | `str` | Sub domain (what comes after `domain`) | | ||
| `publicSuffix` | `str` | Public Suffix (tld) of `hostname` | | ||
| `isIcann` | `bool` | Does TLD come from ICANN part of the list | | ||
| `isPrivate` | `bool` | Does TLD come from Private part of the list | | ||
| `isIP` | `bool` | Is `hostname` an IP address? | | ||
| Property Name | Type | Description | | ||
|:--------------------- |:------ |:----------------------------------------------- | | ||
| `hostname` | `str` | `hostname` of the input extracted automatically | | ||
| `domain` | `str` | Domain (tld + sld) | | ||
| `domainWithoutSuffix` | `str` | Domain without public suffix | | ||
| `subdomain` | `str` | Sub domain (what comes after `domain`) | | ||
| `publicSuffix` | `str` | Public Suffix (tld) of `hostname` | | ||
| `isIcann` | `bool` | Does TLD come from ICANN part of the list | | ||
| `isPrivate` | `bool` | Does TLD come from Private part of the list | | ||
| `isIP` | `bool` | Is `hostname` an IP address? | | ||
@@ -217,2 +227,18 @@ | ||
### getDomainWithoutSuffix(url | hostname, options?) | ||
Returns the domain (as returned by `getDomain(...)`) without the public suffix part. | ||
```javascript | ||
const { getDomainWithoutSuffix } = require('tldts'); | ||
getDomainWithoutSuffix('google.com'); // returns `google` | ||
getDomainWithoutSuffix('fr.google.com'); // returns `google` | ||
getDomainWithoutSuffix('fr.google.google'); // returns `google` | ||
getDomainWithoutSuffix('foo.google.co.uk'); // returns `google` | ||
getDomainWithoutSuffix('t.co'); // returns `t` | ||
getDomainWithoutSuffix('fr.t.co'); // returns `t` | ||
getDomainWithoutSuffix('https://user:password@example.co.uk:8080/some/path?and&query#hash'); // returns `example` | ||
``` | ||
### getSubdomain(url | hostname, options?) | ||
@@ -219,0 +245,0 @@ |
Sorry, the diff of this file is too big to display
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 too big to display
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 too big to display
Sorry, the diff of this file is not supported yet
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
2073
319
0
1277688
Updatedtldts-core@^5.4.0