diff --git a/.changeset/kind-suns-rhyme.md b/.changeset/kind-suns-rhyme.md new file mode 100644 index 00000000..6d73272f --- /dev/null +++ b/.changeset/kind-suns-rhyme.md @@ -0,0 +1,5 @@ +--- +'nxjs-runtime': patch +--- + +Fix `resolve()` being inadventently added as a global function diff --git a/packages/runtime/src/dns.ts b/packages/runtime/src/dns.ts index ada9158a..f2e87680 100644 --- a/packages/runtime/src/dns.ts +++ b/packages/runtime/src/dns.ts @@ -1,15 +1,6 @@ import { $ } from './$'; import { toPromise } from './utils'; -/** - * Performs a DNS lookup to resolve a hostname to an array of IP addresses. - * - * @example - * - * ```typescript - * const ipAddresses = await Switch.resolveDns('example.com'); - * ``` - */ export function resolve(hostname: string) { return toPromise($.dnsResolve, hostname); } diff --git a/packages/runtime/src/switch.ts b/packages/runtime/src/switch.ts index e28c5d72..fdd83a66 100644 --- a/packages/runtime/src/switch.ts +++ b/packages/runtime/src/switch.ts @@ -539,7 +539,18 @@ export class SwitchClass extends EventTarget { return this.native.chdir(String(dir)); } - resolveDns = dnsResolve; + /** + * Performs a DNS lookup to resolve a hostname to an array of IP addresses. + * + * @example + * + * ```typescript + * const ipAddresses = await Switch.resolveDns('example.com'); + * ``` + */ + resolveDns(hostname: string) { + return dnsResolve(hostname); + } /** * Returns a Promise which resolves to an `ArrayBuffer` containing