From 75aa6a1a6bb34008c6a9e8658abceed1040e3f2c Mon Sep 17 00:00:00 2001 From: MrOrz Date: Mon, 19 May 2025 00:04:42 +0800 Subject: [PATCH] fix: add / to punycode import to use userland punycode.js --- src/utils.ts | 6 +++--- src/whoiser.ts | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/utils.ts b/src/utils.ts index 9b710e2f0..7076030e3 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -1,4 +1,4 @@ -import { toASCII } from 'punycode' +import { toASCII } from 'punycode/' export function splitStringBy(string: string, by: number): [string, string] { return [string.slice(0, by), string.slice(by + 1)] @@ -6,8 +6,8 @@ export function splitStringBy(string: string, by: number): [string, string] { /** * Check if a string is a valid TLD, and return it in canonical form. - * - * @param tld + * + * @param tld * @returns The normalized TLD * @throws If the TLD is invalid */ diff --git a/src/whoiser.ts b/src/whoiser.ts index 5011f9748..220c04572 100644 --- a/src/whoiser.ts +++ b/src/whoiser.ts @@ -1,5 +1,5 @@ import net from 'node:net' -import punycode from 'punycode' +import punycode from 'punycode/' import type { DomainWhoisOptions, TldWhoisResponse, WhoisData } from './types.ts' import { parseSimpleWhois, parseDomainWhois, whoisDataToGroups } from './parsers.ts' @@ -86,7 +86,7 @@ export function whoisQuery(host: string, query: string, timeout: number = 5000): /** * TLD WHOIS data, from the [IANA WHOIS](https://www.iana.org/whois) server. - * + * * @param tld TLD/SLD to query. Example: 'com', '.co.uk' * @param timeout Timeout for WHOIS query in milliseconds * @returns Normalized WHOIS data @@ -257,7 +257,7 @@ async function findWhoisServerInIana(query: string) { /** * IP WHOIS data, from the [IANA WHOIS](https://www.iana.org/whois) server. - * + * * @param ip IP address to query. Example: '192.0.2.1' * @param options Options for WHOIS query * @returns Normalized WHOIS data