How to use tr46 - 8 common examples

To help you get started, we’ve selected a few tr46 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 stasm / innerself / node_modules / whatwg-url / lib / url-state-machine.js View on Github external
function domainToASCII(domain, beStrict = false) {
  const result = tr46.toASCII(domain, {
    checkBidi: true,
    checkHyphens: false,
    checkJoiners: true,
    useSTD3ASCIIRules: beStrict,
    verifyDNSLength: beStrict
  });
  if (result === null) {
    return failure;
  }
  return result;
}
github sx1989827 / DOClever / node_modules / whatwg-url / lib / url-state-machine.js View on Github external
function domainToASCII(domain, beStrict = false) {
  const result = tr46.toASCII(domain, {
    checkBidi: true,
    checkHyphens: false,
    checkJoiners: true,
    useSTD3ASCIIRules: beStrict,
    verifyDNSLength: beStrict
  });
  if (result === null) {
    return failure;
  }
  return result;
}
github foo-software / lighthouse-check-action / node_modules / data-urls / node_modules / whatwg-url / lib / url-state-machine.js View on Github external
function domainToASCII(domain, beStrict = false) {
  const result = tr46.toASCII(domain, {
    checkBidi: true,
    checkHyphens: false,
    checkJoiners: true,
    useSTD3ASCIIRules: beStrict,
    verifyDNSLength: beStrict
  });
  if (result === null) {
    return failure;
  }
  return result;
}
github zubairghori / Ultimate_todo_list / node_modules / whatwg-url / lib / url-state-machine.js View on Github external
function domainToASCII(domain, beStrict = false) {
  const result = tr46.toASCII(domain, {
    checkBidi: true,
    checkHyphens: false,
    checkJoiners: true,
    useSTD3ASCIIRules: beStrict,
    verifyDNSLength: beStrict
  });
  if (result === null) {
    return failure;
  }
  return result;
}
github abhaydoke09 / Deep-Learning-For-Surveillance / FrontEnd / node_modules / whatwg-url / lib / url-state-machine.js View on Github external
function parseHost(input, isSpecialArg) {
  if (input[0] === "[") {
    if (input[input.length - 1] !== "]") {
      return failure;
    }

    return parseIPv6(input.substring(1, input.length - 1));
  }

  if (!isSpecialArg) {
    return parseOpaqueHost(input);
  }

  const domain = utf8PercentDecode(input);
  const asciiDomain = tr46.toASCII(domain, false, tr46.PROCESSING_OPTIONS.NONTRANSITIONAL, false);
  if (asciiDomain === null) {
    return failure;
  }

  if (containsForbiddenHostCodePoint(asciiDomain)) {
    return failure;
  }

  const ipv4Host = parseIPv4(asciiDomain);
  if (typeof ipv4Host === "number" || ipv4Host === failure) {
    return ipv4Host;
  }

  return asciiDomain;
}
github ddwhan0123 / ReactNativeDemo / RouteDemo / node_modules / whatwg-url / lib / url-state-machine.js View on Github external
function parseHost(input, isSpecialArg) {
  if (input[0] === "[") {
    if (input[input.length - 1] !== "]") {
      return failure;
    }

    return parseIPv6(input.substring(1, input.length - 1));
  }

  if (!isSpecialArg) {
    return parseOpaqueHost(input);
  }

  const domain = utf8PercentDecode(input);
  const asciiDomain = tr46.toASCII(domain, false, tr46.PROCESSING_OPTIONS.NONTRANSITIONAL, false);
  if (asciiDomain === null) {
    return failure;
  }

  if (containsForbiddenHostCodePoint(asciiDomain)) {
    return failure;
  }

  const ipv4Host = parseIPv4(asciiDomain);
  if (typeof ipv4Host === "number" || ipv4Host === failure) {
    return ipv4Host;
  }

  return asciiDomain;
}
github abhaydoke09 / Deep-Learning-For-Surveillance / FrontEnd / node_modules / whatwg-url / lib / url-state-machine.js View on Github external
function serializeOrigin(tuple) {
  if (tuple.scheme === undefined || tuple.host === undefined || tuple.port === undefined) {
    return "null";
  }

  let result = tuple.scheme + "://";
  result += tr46.toUnicode(tuple.host, false).domain;

  if (tuple.port !== null) {
    result += ":" + tuple.port;
  }

  return result;
}
github ddwhan0123 / ReactNativeDemo / RouteDemo / node_modules / whatwg-url / lib / url-state-machine.js View on Github external
function serializeOrigin(tuple) {
  if (tuple.scheme === undefined || tuple.host === undefined || tuple.port === undefined) {
    return "null";
  }

  let result = tuple.scheme + "://";
  result += tr46.toUnicode(tuple.host, false).domain;

  if (tuple.port !== null) {
    result += ":" + tuple.port;
  }

  return result;
}

tr46

An implementation of the Unicode UTS #46: Unicode IDNA Compatibility Processing

MIT
Latest version published 1 year ago

Package Health Score

68 / 100
Full package analysis