From 88f6fc6a1684326ae1f947ea8ec24ad0bff0f449 Mon Sep 17 00:00:00 2001 From: Leo Kettmeir Date: Mon, 20 Feb 2023 18:47:42 +0100 Subject: refactor: use ops for idna & punycode (#17817) Towards https://github.com/denoland/deno/issues/17809 --- ext/node/polyfills/url.ts | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) (limited to 'ext/node/polyfills/url.ts') 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); } -- cgit v1.2.3