Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export default function suffixLookup(
hostname: string,
options: ISuffixLookupOptions,
out: IPublicSuffix,
): void {
if (fastPathLookup(hostname, options, out) === true) {
return;
}
const { allowIcannDomains, allowPrivateDomains } = options;
// Keep track of longest match
let matchIndex = -1;
let matchKind = Result.NO_MATCH;
let matchLabels = 0; // Keep track of number of labels currently matched
// Index in the packed array data-structure
let index = 1;
const numberOfHashes = hashHostnameLabelsBackward(
hostname,
packed[0] /* maximumNumberOfLabels */,