Skip to content

Commit

Permalink
Fix resolve() being inadventently added as a global function
Browse files Browse the repository at this point in the history
  • Loading branch information
TooTallNate committed Nov 10, 2023
1 parent 06bdc88 commit 275602f
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 10 deletions.
5 changes: 5 additions & 0 deletions .changeset/kind-suns-rhyme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'nxjs-runtime': patch
---

Fix `resolve()` being inadventently added as a global function
9 changes: 0 additions & 9 deletions packages/runtime/src/dns.ts
Original file line number Diff line number Diff line change
@@ -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);
}
13 changes: 12 additions & 1 deletion packages/runtime/src/switch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 275602f

Please sign in to comment.