From 275602f1404cd4a650cbf0c9d29b6b0f6a292221 Mon Sep 17 00:00:00 2001 From: Nathan Rajlich Date: Fri, 10 Nov 2023 00:01:48 -0800 Subject: [PATCH] Fix `resolve()` being inadventently added as a global function --- .changeset/kind-suns-rhyme.md | 5 +++++ packages/runtime/src/dns.ts | 9 --------- packages/runtime/src/switch.ts | 13 ++++++++++++- 3 files changed, 17 insertions(+), 10 deletions(-) create mode 100644 .changeset/kind-suns-rhyme.md 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