Comparing version 5.5.0 to 5.6.0
@@ -1,21 +0,36 @@ | ||
import { parseImpl } from 'tldts-core'; | ||
import { getEmptyResult, parseImpl, resetResult } from 'tldts-core'; | ||
import suffixLookup from './src/suffix-trie'; | ||
// For all methods but 'parse', it does not make sense to allocate an object | ||
// every single time to only return the value of a specific attribute. To avoid | ||
// this un-necessary allocation, we use a global object which is re-used. | ||
var RESULT = getEmptyResult(); | ||
export function parse(url, options) { | ||
return parseImpl(url, 5 /* ALL */, suffixLookup, options); | ||
if (options === void 0) { options = {}; } | ||
return parseImpl(url, 5 /* ALL */, suffixLookup, options, getEmptyResult()); | ||
} | ||
export function getHostname(url, options) { | ||
if (options === void 0) { options = {}; } | ||
resetResult(RESULT); | ||
return parseImpl(url, 0 /* HOSTNAME */, suffixLookup, options, RESULT).hostname; | ||
} | ||
export function getPublicSuffix(url, options) { | ||
return parseImpl(url, 2 /* PUBLIC_SUFFIX */, suffixLookup, options).publicSuffix; | ||
if (options === void 0) { options = {}; } | ||
resetResult(RESULT); | ||
return parseImpl(url, 2 /* PUBLIC_SUFFIX */, suffixLookup, options, RESULT).publicSuffix; | ||
} | ||
export function getDomain(url, options) { | ||
return parseImpl(url, 3 /* DOMAIN */, suffixLookup, options).domain; | ||
if (options === void 0) { options = {}; } | ||
resetResult(RESULT); | ||
return parseImpl(url, 3 /* DOMAIN */, suffixLookup, options, RESULT).domain; | ||
} | ||
export function getSubdomain(url, options) { | ||
return parseImpl(url, 4 /* SUB_DOMAIN */, suffixLookup, options).subdomain; | ||
if (options === void 0) { options = {}; } | ||
resetResult(RESULT); | ||
return parseImpl(url, 4 /* SUB_DOMAIN */, suffixLookup, options, RESULT).subdomain; | ||
} | ||
export function getHostname(url, options) { | ||
return parseImpl(url, 0 /* HOSTNAME */, suffixLookup, options).hostname; | ||
} | ||
export function getDomainWithoutSuffix(url, options) { | ||
return parseImpl(url, 5 /* ALL */, suffixLookup, options).domainWithoutSuffix; | ||
if (options === void 0) { options = {}; } | ||
resetResult(RESULT); | ||
return parseImpl(url, 5 /* ALL */, suffixLookup, options, RESULT).domainWithoutSuffix; | ||
} | ||
//# sourceMappingURL=index.js.map |
import { IOptions, IResult } from 'tldts-core'; | ||
export declare function parse(url: string, options?: Partial<IOptions>): IResult; | ||
export declare function getHostname(url: string, options?: Partial<IOptions>): string | null; | ||
export declare function getPublicSuffix(url: string, options?: Partial<IOptions>): string | null; | ||
export declare function getDomain(url: string, options?: Partial<IOptions>): string | null; | ||
export declare function getSubdomain(url: string, options?: Partial<IOptions>): string | null; | ||
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.5.0", | ||
"version": "5.6.0", | ||
"description": "Library to work against complex domain names, subdomains and URIs.", | ||
@@ -65,3 +65,3 @@ "author": { | ||
"rollup-plugin-sourcemaps": "^0.4.2", | ||
"tldts-tests": "^5.5.0", | ||
"tldts-tests": "^5.6.0", | ||
"ts-jest": "^24.0.2", | ||
@@ -73,3 +73,3 @@ "tslint": "^5.18.0", | ||
"dependencies": { | ||
"tldts-core": "^5.5.0" | ||
"tldts-core": "^5.6.0" | ||
}, | ||
@@ -91,3 +91,3 @@ "keywords": [ | ||
], | ||
"gitHead": "90232f6af7824bce179d80d4ea3b6fdb17655d98" | ||
"gitHead": "2a8c96aa9e692d9426b0a85c0db29939f3d58fce" | ||
} |
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
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
1728720
2542
Updatedtldts-core@^5.6.0