diff options
| author | Leo Kettmeir <crowlkats@toaxl.com> | 2023-02-20 18:47:42 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-02-20 18:47:42 +0100 |
| commit | 88f6fc6a1684326ae1f947ea8ec24ad0bff0f449 (patch) | |
| tree | 0fa821ef0ff1ff5120ce43bf0d6052767d1f792b /ext/node/polyfills/url.ts | |
| parent | ea7ca00c895c401af57a7201f3c41524333e7939 (diff) | |
refactor: use ops for idna & punycode (#17817)
Towards https://github.com/denoland/deno/issues/17809
Diffstat (limited to 'ext/node/polyfills/url.ts')
| -rw-r--r-- | ext/node/polyfills/url.ts | 15 |
1 files changed, 1 insertions, 14 deletions
diff --git a/ext/node/polyfills/url.ts b/ext/node/polyfills/url.ts index 31b1e676f..6d38fd1ff 100644 --- a/ext/node/polyfills/url.ts +++ b/ext/node/polyfills/url.ts @@ -67,12 +67,7 @@ import { CHAR_ZERO_WIDTH_NOBREAK_SPACE, } from "internal:deno_node/polyfills/path/_constants.ts"; import * as path from "internal:deno_node/polyfills/path.ts"; -import { - regexNonASCII, - regexPunycode, - toASCII, - toUnicode, -} from "internal:deno_node/polyfills/internal/idna.ts"; +import { toASCII, toUnicode } from "internal:deno_node/polyfills/punycode.ts"; import { isWindows, osType } from "internal:deno_node/polyfills/_util/os.ts"; import { encodeStr, @@ -1263,10 +1258,6 @@ export function resolveObject(source: string | Url, relative: string) { * @see https://www.rfc-editor.org/rfc/rfc3490#section-4 */ export function domainToASCII(domain: string) { - if (regexPunycode.test(domain) && regexNonASCII.test(domain)) { - return ""; // Failure case - } - return toASCII(domain); } @@ -1277,10 +1268,6 @@ export function domainToASCII(domain: string) { * @see https://www.rfc-editor.org/rfc/rfc3490#section-4 */ export function domainToUnicode(domain: string) { - if (regexPunycode.test(domain) && regexNonASCII.test(domain)) { - return ""; // Failure case - } - return toUnicode(domain); } |
