aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Ashcon Partovi <ashcon@partovi.net> 2023-01-17 18:12:49 -0800
committerGravatar GitHub <noreply@github.com> 2023-01-17 18:12:49 -0800
commit6fbf437f503205ec13c12be1fcd130dd8d1a3c8a (patch)
tree2eea9c39e31bf7269d4f286d911cad113371d2ed
parentc00fadab9e7f800fe519cc25731d5de029973012 (diff)
downloadbun-6fbf437f503205ec13c12be1fcd130dd8d1a3c8a.tar.gz
bun-6fbf437f503205ec13c12be1fcd130dd8d1a3c8a.tar.zst
bun-6fbf437f503205ec13c12be1fcd130dd8d1a3c8a.zip
Fix `Bun.dns` examples to use array instead of single result
-rw-r--r--packages/bun-types/bun.d.ts14
1 files changed, 7 insertions, 7 deletions
diff --git a/packages/bun-types/bun.d.ts b/packages/bun-types/bun.d.ts
index c6b00a3a2..c577d50ec 100644
--- a/packages/bun-types/bun.d.ts
+++ b/packages/bun-types/bun.d.ts
@@ -411,22 +411,22 @@ declare module "bun" {
* ## Example
*
* ```js
- * const {address} = await Bun.dns.lookup('example.com');
+ * const [{ address }] = await Bun.dns.lookup('example.com');
* ```
*
* ### Filter results to IPv4:
*
* ```js
- * import {dns} from 'bun';
- * const {address} = await dns.lookup('example.com', {family: 4});
+ * import { dns } from 'bun';
+ * const [{ address }] = await dns.lookup('example.com', {family: 4});
* console.log(address); // "123.122.22.126"
* ```
*
* ### Filter results to IPv6:
*
* ```js
- * import {dns} from 'bun';
- * const {address} = await dns.lookup('example.com', {family: 6});
+ * import { dns } from 'bun';
+ * const [{ address }] = await dns.lookup('example.com', {family: 6});
* console.log(address); // "2001:db8::1"
* ```
*
@@ -439,8 +439,8 @@ declare module "bun" {
*
* To customize the DNS resolver, pass a `backend` option to `dns.lookup`:
* ```js
- * import {dns} from 'bun';
- * const {address} = await dns.lookup('example.com', {backend: 'getaddrinfo'});
+ * import { dns } from 'bun';
+ * const [{ address }] = await dns.lookup('example.com', {backend: 'getaddrinfo'});
* console.log(address); // "19.42.52.62"
* ```
*/