How to use the tldts-core.resetResult function in tldts-core

To help you get started, we’ve selected a few tldts-core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github remusao / tldts / packages / tldts-experimental / index.ts View on Github external
export function getSubdomain(
  url: string,
  options: Partial = {},
): string | null {
  resetResult(RESULT);
  return parseImpl(url, FLAG.SUB_DOMAIN, suffixLookup, options, RESULT).subdomain;
}
github remusao / tldts / packages / tldts-experimental / index.ts View on Github external
export function getPublicSuffix(
  url: string,
  options: Partial = {},
): string | null {
  resetResult(RESULT);
  return parseImpl(url, FLAG.PUBLIC_SUFFIX, suffixLookup, options, RESULT).publicSuffix;
}
github remusao / tldts / packages / tldts / index.ts View on Github external
export function getDomainWithoutSuffix(
  url: string,
  options: Partial = {},
): string | null {
  resetResult(RESULT);
  return parseImpl(url, FLAG.ALL, suffixLookup, options, RESULT).domainWithoutSuffix;
}
github remusao / tldts / packages / tldts / index.ts View on Github external
export function getSubdomain(
  url: string,
  options: Partial = {},
): string | null {
  resetResult(RESULT);
  return parseImpl(url, FLAG.SUB_DOMAIN, suffixLookup, options, RESULT).subdomain;
}
github remusao / tldts / packages / tldts / index.ts View on Github external
export function getPublicSuffix(
  url: string,
  options: Partial = {},
): string | null {
  resetResult(RESULT);
  return parseImpl(url, FLAG.PUBLIC_SUFFIX, suffixLookup, options, RESULT).publicSuffix;
}
github remusao / tldts / packages / tldts / index.ts View on Github external
export function getHostname(
  url: string,
  options: Partial = {},
): string | null {
  resetResult(RESULT);
  return parseImpl(url, FLAG.HOSTNAME, suffixLookup, options, RESULT).hostname;
}
github remusao / tldts / packages / tldts-experimental / index.ts View on Github external
export function getDomainWithoutSuffix(
  url: string,
  options: Partial = {},
): string | null {
  resetResult(RESULT);
  return parseImpl(url, FLAG.ALL, suffixLookup, options, RESULT).domainWithoutSuffix;
}
github remusao / tldts / packages / tldts-experimental / index.ts View on Github external
export function getHostname(
  url: string,
  options: Partial = {},
): string | null {
  resetResult(RESULT);
  return parseImpl(url, FLAG.HOSTNAME, suffixLookup, options, RESULT).hostname;
}
github remusao / tldts / packages / tldts-experimental / index.ts View on Github external
export function getDomain(
  url: string,
  options: Partial = {},
): string | null {
  resetResult(RESULT);
  return parseImpl(url, FLAG.DOMAIN, suffixLookup, options, RESULT).domain;
}
github remusao / tldts / packages / tldts / index.ts View on Github external
export function getDomain(
  url: string,
  options: Partial = {},
): string | null {
  resetResult(RESULT);
  return parseImpl(url, FLAG.DOMAIN, suffixLookup, options, RESULT).domain;
}

tldts-core

tldts core primitives (internal module)

MIT
Latest version published 2 days ago

Package Health Score

85 / 100
Full package analysis

Similar packages