tldts-core
Advanced tools
Comparing version 5.5.0 to 5.6.0
@@ -383,5 +383,4 @@ 'use strict'; | ||
*/ | ||
function parseImpl(url, step, suffixLookup, partialOptions) { | ||
var options = setDefaults(partialOptions); | ||
var result = { | ||
function getEmptyResult() { | ||
return { | ||
domain: null, | ||
@@ -396,2 +395,15 @@ domainWithoutSuffix: null, | ||
}; | ||
} | ||
function resetResult(result) { | ||
result.domain = null; | ||
result.domainWithoutSuffix = null; | ||
result.hostname = null; | ||
result.isIcann = null; | ||
result.isIp = null; | ||
result.isPrivate = null; | ||
result.publicSuffix = null; | ||
result.subdomain = null; | ||
} | ||
function parseImpl(url, step, suffixLookup, partialOptions, result) { | ||
var options = setDefaults(partialOptions); | ||
// Very fast approximate check to make sure `url` is a string. This is needed | ||
@@ -527,4 +539,6 @@ // because the library will not necessarily be used in a typed setup and | ||
exports.fastPathLookup = fastPath; | ||
exports.getEmptyResult = getEmptyResult; | ||
exports.parseImpl = parseImpl; | ||
exports.resetResult = resetResult; | ||
exports.setDefaults = setDefaults; | ||
//# sourceMappingURL=index.js.map |
@@ -1,4 +0,4 @@ | ||
export { parseImpl } from './src/factory'; | ||
export { parseImpl, getEmptyResult, resetResult } from './src/factory'; | ||
export { default as fastPathLookup } from './src/lookup/fast-path'; | ||
export { setDefaults } from './src/options'; | ||
//# sourceMappingURL=index.js.map |
@@ -13,5 +13,4 @@ /** | ||
import getSubdomain from './subdomain'; | ||
export function parseImpl(url, step, suffixLookup, partialOptions) { | ||
var options = setDefaults(partialOptions); | ||
var result = { | ||
export function getEmptyResult() { | ||
return { | ||
domain: null, | ||
@@ -26,2 +25,15 @@ domainWithoutSuffix: null, | ||
}; | ||
} | ||
export function resetResult(result) { | ||
result.domain = null; | ||
result.domainWithoutSuffix = null; | ||
result.hostname = null; | ||
result.isIcann = null; | ||
result.isIp = null; | ||
result.isPrivate = null; | ||
result.publicSuffix = null; | ||
result.subdomain = null; | ||
} | ||
export function parseImpl(url, step, suffixLookup, partialOptions, result) { | ||
var options = setDefaults(partialOptions); | ||
// Very fast approximate check to make sure `url` is a string. This is needed | ||
@@ -28,0 +40,0 @@ // because the library will not necessarily be used in a typed setup and |
@@ -1,4 +0,4 @@ | ||
export { FLAG, parseImpl, IResult } from './src/factory'; | ||
export { FLAG, parseImpl, IResult, getEmptyResult, resetResult } from './src/factory'; | ||
export { IPublicSuffix, ISuffixLookupOptions } from './src/lookup/interface'; | ||
export { default as fastPathLookup } from './src/lookup/fast-path'; | ||
export { IOptions, setDefaults } from './src/options'; |
@@ -18,2 +18,4 @@ /** | ||
} | ||
export declare function getEmptyResult(): IResult; | ||
export declare function resetResult(result: IResult): void; | ||
export declare const enum FLAG { | ||
@@ -27,2 +29,2 @@ HOSTNAME = 0, | ||
} | ||
export declare function parseImpl(url: string, step: FLAG, suffixLookup: (_1: string, _2: ISuffixLookupOptions, _3: IPublicSuffix) => void, partialOptions?: Partial<IOptions>): IResult; | ||
export declare function parseImpl(url: string, step: FLAG, suffixLookup: (_1: string, _2: ISuffixLookupOptions, _3: IPublicSuffix) => void, partialOptions: Partial<IOptions>, result: IResult): IResult; |
{ | ||
"name": "tldts-core", | ||
"version": "5.5.0", | ||
"version": "5.6.0", | ||
"description": "tldts core primitives (internal module)", | ||
@@ -66,3 +66,3 @@ "author": { | ||
}, | ||
"gitHead": "90232f6af7824bce179d80d4ea3b6fdb17655d98" | ||
"gitHead": "2a8c96aa9e692d9426b0a85c0db29939f3d58fce" | ||
} |
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
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
183141
1166