aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/js/node/dns.js13
-rw-r--r--src/js/out/InternalModuleRegistryConstants.h6
-rw-r--r--test/js/node/dns/node-dns.test.js17
3 files changed, 33 insertions, 3 deletions
diff --git a/src/js/node/dns.js b/src/js/node/dns.js
index 2dc3895a2..bb59e702f 100644
--- a/src/js/node/dns.js
+++ b/src/js/node/dns.js
@@ -19,6 +19,19 @@ function lookup(domain, options, callback) {
options = { family: options };
}
+ const invalidDomainValues = [
+ undefined,
+ false,
+ null,
+ ""
+ ];
+
+ if(Number.isNaN(domain) || invalidDomainValues.some(value => domain === value)) {
+ console.warn(`DeprecationWarning: The provided hostname "${String(domain)}" is not a valid hostname, and is supported in the dns module solely for compatibility.`);
+ callback(null, null, 4);
+ return;
+ }
+
dns.lookup(domain, options).then(
res => {
res.sort((a, b) => a.family - b.family);
diff --git a/src/js/out/InternalModuleRegistryConstants.h b/src/js/out/InternalModuleRegistryConstants.h
index 292e29150..b63c8df46 100644
--- a/src/js/out/InternalModuleRegistryConstants.h
+++ b/src/js/out/InternalModuleRegistryConstants.h
@@ -74,7 +74,7 @@ static constexpr ASCIILiteral NodeDiagnosticsChannelCode = "(function (){\"use s
//
//
-static constexpr ASCIILiteral NodeDNSCode = "(function (){\"use strict\";// src/js/out/tmp/node/dns.ts\nvar getServers = function() {\n return dns.getServers();\n}, lookup = function(domain, options, callback) {\n if (typeof options == \"function\")\n callback = options;\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n if (typeof options == \"number\")\n options = { family: options };\n dns.lookup(domain, options).then((res) => {\n if (res.sort((a, b) => a.family - b.family), options\?.all)\n callback(null, res.map(mapLookupAll));\n else {\n const [{ address, family }] = res;\n callback(null, address, family);\n }\n }, (error) => {\n callback(error);\n });\n}, resolveSrv = function(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveSrv(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n}, resolveTxt = function(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveTxt(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n}, resolveSoa = function(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveSoa(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n}, resolveNaptr = function(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveNaptr(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n}, resolveMx = function(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveMx(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n}, resolveCaa = function(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveCaa(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n}, resolveNs = function(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveNs(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n}, resolvePtr = function(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolvePtr(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n}, resolveCname = function(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveCname(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n}, lookupService = function(address, port, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.lookupService(address, port, callback).then((results) => {\n callback(null, ...results);\n }, (error) => {\n callback(error);\n });\n}, reverse = function(ip, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.reverse(ip, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n}, resolve = function(hostname, rrtype, callback) {\n if (typeof rrtype == \"function\")\n callback = rrtype;\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolve(hostname).then((results) => {\n switch (rrtype\?.toLowerCase()) {\n case \"a\":\n case \"aaaa\":\n callback(null, hostname, results.map(({ address }) => address));\n break;\n default:\n callback(null, results);\n break;\n }\n }, (error) => {\n callback(error);\n });\n}, Resolver = function(options) {\n return new InternalResolver(options);\n}, setDefaultResultOrder = function() {\n}, setServers = function() {\n}, $, dns = Bun.dns, InternalResolver = class Resolver2 {\n constructor(options) {\n }\n cancel() {\n }\n getServers() {\n return [];\n }\n resolve(hostname, rrtype, callback) {\n if (typeof rrtype == \"function\")\n callback = rrtype, rrtype = null;\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolve(hostname).then((results) => {\n switch (rrtype\?.toLowerCase()) {\n case \"a\":\n case \"aaaa\":\n callback(null, hostname, results.map(mapResolveX));\n break;\n default:\n callback(null, results);\n break;\n }\n }, (error) => {\n callback(error);\n });\n }\n resolve4(hostname, options, callback) {\n if (typeof options == \"function\")\n callback = options, options = null;\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.lookup(hostname, { family: 4 }).then((addresses) => {\n callback(null, options\?.ttl \? addresses : addresses.map(mapResolveX));\n }, (error) => {\n callback(error);\n });\n }\n resolve6(hostname, options, callback) {\n if (typeof options == \"function\")\n callback = options, options = null;\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.lookup(hostname, { family: 6 }).then((addresses) => {\n callback(null, options\?.ttl \? addresses : addresses.map(({ address }) => address));\n }, (error) => {\n callback(error);\n });\n }\n resolveAny(hostname, callback) {\n callback(null, []);\n }\n resolveCname(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveCname(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n }\n resolveMx(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveMx(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n }\n resolveNaptr(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveNaptr(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n }\n resolveNs(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveNs(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n }\n resolvePtr(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolvePtr(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n }\n resolveSrv(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveSrv(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n }\n resolveCaa(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveCaa(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n }\n resolveTxt(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveTxt(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n }\n resolveSoa(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveSoa(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n }\n reverse(ip, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.reverse(ip, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n }\n setServers(servers) {\n }\n};\nResolver.prototype = {};\nObject.setPrototypeOf(Resolver.prototype, InternalResolver.prototype);\nObject.setPrototypeOf(Resolver, InternalResolver);\nvar {\n resolve,\n resolve4,\n resolve6,\n resolveAny,\n resolveCname,\n resolveCaa,\n resolveMx,\n resolveNaptr,\n resolveNs,\n resolvePtr,\n resolveSoa,\n resolveSrv,\n reverse,\n resolveTxt\n} = InternalResolver.prototype, promisifyLookup = (res) => {\n res.sort((a, b) => a.family - b.family);\n const [{ address, family }] = res;\n return { address, family };\n}, mapLookupAll = (res) => {\n const { address, family } = res;\n return { address, family };\n}, promisifyLookupAll = (res) => {\n return res.sort((a, b) => a.family - b.family), res.map(mapLookupAll);\n}, mapResolveX = (a) => a.address, promisifyResolveX = (res) => {\n return res\?.map(mapResolveX);\n}, promises = {\n lookup(domain, options) {\n if (options\?.all)\n return dns.lookup(domain, options).then(promisifyLookupAll);\n return dns.lookup(domain, options).then(promisifyLookup);\n },\n lookupService(address, port) {\n return dns.lookupService(address, port);\n },\n resolve(hostname, rrtype) {\n if (typeof rrtype !== \"string\")\n rrtype = null;\n switch (rrtype\?.toLowerCase()) {\n case \"a\":\n case \"aaaa\":\n return dns.resolve(hostname, rrtype).then(promisifyLookup);\n default:\n return dns.resolve(hostname, rrtype);\n }\n },\n resolve4(hostname, options) {\n if (options\?.ttl)\n return dns.lookup(hostname, { family: 4 });\n return dns.lookup(hostname, { family: 4 }).then(promisifyResolveX);\n },\n resolve6(hostname, options) {\n if (options\?.ttl)\n return dns.lookup(hostname, { family: 6 });\n return dns.lookup(hostname, { family: 6 }).then(promisifyResolveX);\n },\n resolveSrv(hostname) {\n return dns.resolveSrv(hostname);\n },\n resolveTxt(hostname) {\n return dns.resolveTxt(hostname);\n },\n resolveSoa(hostname) {\n return dns.resolveSoa(hostname);\n },\n resolveNaptr(hostname) {\n return dns.resolveNaptr(hostname);\n },\n resolveMx(hostname) {\n return dns.resolveMx(hostname);\n },\n resolveCaa(hostname) {\n return dns.resolveCaa(hostname);\n },\n resolveNs(hostname) {\n return dns.resolveNs(hostname);\n },\n resolvePtr(hostname) {\n return dns.resolvePtr(hostname);\n },\n resolveCname(hostname) {\n return dns.resolveCname(hostname);\n },\n reverse(ip) {\n return dns.reverse(ip);\n },\n Resolver: class Resolver3 {\n constructor(options) {\n }\n cancel() {\n }\n getServers() {\n return [];\n }\n resolve(hostname, rrtype) {\n if (typeof rrtype !== \"string\")\n rrtype = null;\n switch (rrtype\?.toLowerCase()) {\n case \"a\":\n case \"aaaa\":\n return dns.resolve(hostname, rrtype).then(promisifyLookup);\n default:\n return dns.resolve(hostname, rrtype);\n }\n }\n resolve4(hostname, options) {\n if (options\?.ttl)\n return dns.lookup(hostname, { family: 4 });\n return dns.lookup(hostname, { family: 4 }).then(promisifyResolveX);\n }\n resolve6(hostname, options) {\n if (options\?.ttl)\n return dns.lookup(hostname, { family: 6 });\n return dns.lookup(hostname, { family: 6 }).then(promisifyResolveX);\n }\n resolveAny(hostname) {\n return @Promise.resolve([]);\n }\n resolveCname(hostname) {\n return dns.resolveCname(hostname);\n }\n resolveMx(hostname) {\n return dns.resolveMx(hostname);\n }\n resolveNaptr(hostname) {\n return dns.resolveNaptr(hostname);\n }\n resolveNs(hostname) {\n return dns.resolveNs(hostname);\n }\n resolvePtr(hostname) {\n return dns.resolvePtr(hostname);\n }\n resolveSoa(hostname) {\n return dns.resolveSoa(hostname);\n }\n resolveSrv(hostname) {\n return dns.resolveSrv(hostname);\n }\n resolveCaa(hostname) {\n return dns.resolveCaa(hostname);\n }\n resolveTxt(hostname) {\n return dns.resolveTxt(hostname);\n }\n reverse(ip) {\n return dns.reverse(ip);\n }\n setServers(servers) {\n }\n }\n};\nfor (let key of [\"resolveAny\"])\n promises[key] = () => @Promise.resolve(@undefined);\n$ = {\n ADDRCONFIG: 0,\n ALL: 1,\n V4MAPPED: 2,\n NODATA: \"DNS_ENODATA\",\n FORMERR: \"DNS_EFORMERR\",\n SERVFAIL: \"DNS_ESERVFAIL\",\n NOTFOUND: \"DNS_ENOTFOUND\",\n NOTIMP: \"DNS_ENOTIMP\",\n REFUSED: \"DNS_EREFUSED\",\n BADQUERY: \"DNS_EBADQUERY\",\n BADNAME: \"DNS_EBADNAME\",\n BADFAMILY: \"DNS_EBADFAMILY\",\n BADRESP: \"DNS_EBADRESP\",\n CONNREFUSED: \"DNS_ECONNREFUSED\",\n TIMEOUT: \"DNS_ETIMEOUT\",\n EOF: \"DNS_EEOF\",\n FILE: \"DNS_EFILE\",\n NOMEM: \"DNS_ENOMEM\",\n DESTRUCTION: \"DNS_EDESTRUCTION\",\n BADSTR: \"DNS_EBADSTR\",\n BADFLAGS: \"DNS_EBADFLAGS\",\n NONAME: \"DNS_ENONAME\",\n BADHINTS: \"DNS_EBADHINTS\",\n NOTINITIALIZED: \"DNS_ENOTINITIALIZED\",\n LOADIPHLPAPI: \"DNS_ELOADIPHLPAPI\",\n ADDRGETNETWORKPARAMS: \"DNS_EADDRGETNETWORKPARAMS\",\n CANCELLED: \"DNS_ECANCELLED\",\n lookup,\n lookupService,\n Resolver,\n setServers,\n setDefaultResultOrder,\n resolve,\n reverse,\n resolve4,\n resolve6,\n resolveAny,\n resolveCname,\n resolveCaa,\n resolveMx,\n resolveNs,\n resolvePtr,\n resolveSoa,\n resolveSrv,\n resolveTxt,\n resolveNaptr,\n promises,\n getServers\n};\nreturn $})\n"_s;
+static constexpr ASCIILiteral NodeDNSCode = "(function (){\"use strict\";// src/js/out/tmp/node/dns.ts\nvar getServers = function() {\n return dns.getServers();\n}, lookup = function(domain, options, callback) {\n if (typeof options == \"function\")\n callback = options;\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n if (typeof options == \"number\")\n options = { family: options };\n const invalidDomainValues = [\n @undefined,\n !1,\n null,\n \"\"\n ];\n if (Number.isNaN(domain) || invalidDomainValues.some((value) => domain === value)) {\n console.warn(`DeprecationWarning: The provided hostname \"${@String(domain)}\" is not a valid hostname, and is supported in the dns module solely for compatibility.`), callback(null, null, 4);\n return;\n }\n dns.lookup(domain, options).then((res) => {\n if (res.sort((a, b) => a.family - b.family), options\?.all)\n callback(null, res.map(mapLookupAll));\n else {\n const [{ address, family }] = res;\n callback(null, address, family);\n }\n }, (error) => {\n callback(error);\n });\n}, resolveSrv = function(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveSrv(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n}, resolveTxt = function(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveTxt(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n}, resolveSoa = function(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveSoa(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n}, resolveNaptr = function(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveNaptr(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n}, resolveMx = function(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveMx(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n}, resolveCaa = function(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveCaa(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n}, resolveNs = function(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveNs(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n}, resolvePtr = function(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolvePtr(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n}, resolveCname = function(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveCname(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n}, lookupService = function(address, port, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.lookupService(address, port, callback).then((results) => {\n callback(null, ...results);\n }, (error) => {\n callback(error);\n });\n}, reverse = function(ip, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.reverse(ip, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n}, resolve = function(hostname, rrtype, callback) {\n if (typeof rrtype == \"function\")\n callback = rrtype;\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolve(hostname).then((results) => {\n switch (rrtype\?.toLowerCase()) {\n case \"a\":\n case \"aaaa\":\n callback(null, hostname, results.map(({ address }) => address));\n break;\n default:\n callback(null, results);\n break;\n }\n }, (error) => {\n callback(error);\n });\n}, Resolver = function(options) {\n return new InternalResolver(options);\n}, setDefaultResultOrder = function() {\n}, setServers = function() {\n}, $, dns = Bun.dns, InternalResolver = class Resolver2 {\n constructor(options) {\n }\n cancel() {\n }\n getServers() {\n return [];\n }\n resolve(hostname, rrtype, callback) {\n if (typeof rrtype == \"function\")\n callback = rrtype, rrtype = null;\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolve(hostname).then((results) => {\n switch (rrtype\?.toLowerCase()) {\n case \"a\":\n case \"aaaa\":\n callback(null, hostname, results.map(mapResolveX));\n break;\n default:\n callback(null, results);\n break;\n }\n }, (error) => {\n callback(error);\n });\n }\n resolve4(hostname, options, callback) {\n if (typeof options == \"function\")\n callback = options, options = null;\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.lookup(hostname, { family: 4 }).then((addresses) => {\n callback(null, options\?.ttl \? addresses : addresses.map(mapResolveX));\n }, (error) => {\n callback(error);\n });\n }\n resolve6(hostname, options, callback) {\n if (typeof options == \"function\")\n callback = options, options = null;\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.lookup(hostname, { family: 6 }).then((addresses) => {\n callback(null, options\?.ttl \? addresses : addresses.map(({ address }) => address));\n }, (error) => {\n callback(error);\n });\n }\n resolveAny(hostname, callback) {\n callback(null, []);\n }\n resolveCname(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveCname(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n }\n resolveMx(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveMx(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n }\n resolveNaptr(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveNaptr(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n }\n resolveNs(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveNs(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n }\n resolvePtr(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolvePtr(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n }\n resolveSrv(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveSrv(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n }\n resolveCaa(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveCaa(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n }\n resolveTxt(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveTxt(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n }\n resolveSoa(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveSoa(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n }\n reverse(ip, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.reverse(ip, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n }\n setServers(servers) {\n }\n};\nResolver.prototype = {};\nObject.setPrototypeOf(Resolver.prototype, InternalResolver.prototype);\nObject.setPrototypeOf(Resolver, InternalResolver);\nvar {\n resolve,\n resolve4,\n resolve6,\n resolveAny,\n resolveCname,\n resolveCaa,\n resolveMx,\n resolveNaptr,\n resolveNs,\n resolvePtr,\n resolveSoa,\n resolveSrv,\n reverse,\n resolveTxt\n} = InternalResolver.prototype, promisifyLookup = (res) => {\n res.sort((a, b) => a.family - b.family);\n const [{ address, family }] = res;\n return { address, family };\n}, mapLookupAll = (res) => {\n const { address, family } = res;\n return { address, family };\n}, promisifyLookupAll = (res) => {\n return res.sort((a, b) => a.family - b.family), res.map(mapLookupAll);\n}, mapResolveX = (a) => a.address, promisifyResolveX = (res) => {\n return res\?.map(mapResolveX);\n}, promises = {\n lookup(domain, options) {\n if (options\?.all)\n return dns.lookup(domain, options).then(promisifyLookupAll);\n return dns.lookup(domain, options).then(promisifyLookup);\n },\n lookupService(address, port) {\n return dns.lookupService(address, port);\n },\n resolve(hostname, rrtype) {\n if (typeof rrtype !== \"string\")\n rrtype = null;\n switch (rrtype\?.toLowerCase()) {\n case \"a\":\n case \"aaaa\":\n return dns.resolve(hostname, rrtype).then(promisifyLookup);\n default:\n return dns.resolve(hostname, rrtype);\n }\n },\n resolve4(hostname, options) {\n if (options\?.ttl)\n return dns.lookup(hostname, { family: 4 });\n return dns.lookup(hostname, { family: 4 }).then(promisifyResolveX);\n },\n resolve6(hostname, options) {\n if (options\?.ttl)\n return dns.lookup(hostname, { family: 6 });\n return dns.lookup(hostname, { family: 6 }).then(promisifyResolveX);\n },\n resolveSrv(hostname) {\n return dns.resolveSrv(hostname);\n },\n resolveTxt(hostname) {\n return dns.resolveTxt(hostname);\n },\n resolveSoa(hostname) {\n return dns.resolveSoa(hostname);\n },\n resolveNaptr(hostname) {\n return dns.resolveNaptr(hostname);\n },\n resolveMx(hostname) {\n return dns.resolveMx(hostname);\n },\n resolveCaa(hostname) {\n return dns.resolveCaa(hostname);\n },\n resolveNs(hostname) {\n return dns.resolveNs(hostname);\n },\n resolvePtr(hostname) {\n return dns.resolvePtr(hostname);\n },\n resolveCname(hostname) {\n return dns.resolveCname(hostname);\n },\n reverse(ip) {\n return dns.reverse(ip);\n },\n Resolver: class Resolver3 {\n constructor(options) {\n }\n cancel() {\n }\n getServers() {\n return [];\n }\n resolve(hostname, rrtype) {\n if (typeof rrtype !== \"string\")\n rrtype = null;\n switch (rrtype\?.toLowerCase()) {\n case \"a\":\n case \"aaaa\":\n return dns.resolve(hostname, rrtype).then(promisifyLookup);\n default:\n return dns.resolve(hostname, rrtype);\n }\n }\n resolve4(hostname, options) {\n if (options\?.ttl)\n return dns.lookup(hostname, { family: 4 });\n return dns.lookup(hostname, { family: 4 }).then(promisifyResolveX);\n }\n resolve6(hostname, options) {\n if (options\?.ttl)\n return dns.lookup(hostname, { family: 6 });\n return dns.lookup(hostname, { family: 6 }).then(promisifyResolveX);\n }\n resolveAny(hostname) {\n return @Promise.resolve([]);\n }\n resolveCname(hostname) {\n return dns.resolveCname(hostname);\n }\n resolveMx(hostname) {\n return dns.resolveMx(hostname);\n }\n resolveNaptr(hostname) {\n return dns.resolveNaptr(hostname);\n }\n resolveNs(hostname) {\n return dns.resolveNs(hostname);\n }\n resolvePtr(hostname) {\n return dns.resolvePtr(hostname);\n }\n resolveSoa(hostname) {\n return dns.resolveSoa(hostname);\n }\n resolveSrv(hostname) {\n return dns.resolveSrv(hostname);\n }\n resolveCaa(hostname) {\n return dns.resolveCaa(hostname);\n }\n resolveTxt(hostname) {\n return dns.resolveTxt(hostname);\n }\n reverse(ip) {\n return dns.reverse(ip);\n }\n setServers(servers) {\n }\n }\n};\nfor (let key of [\"resolveAny\"])\n promises[key] = () => @Promise.resolve(@undefined);\n$ = {\n ADDRCONFIG: 0,\n ALL: 1,\n V4MAPPED: 2,\n NODATA: \"DNS_ENODATA\",\n FORMERR: \"DNS_EFORMERR\",\n SERVFAIL: \"DNS_ESERVFAIL\",\n NOTFOUND: \"DNS_ENOTFOUND\",\n NOTIMP: \"DNS_ENOTIMP\",\n REFUSED: \"DNS_EREFUSED\",\n BADQUERY: \"DNS_EBADQUERY\",\n BADNAME: \"DNS_EBADNAME\",\n BADFAMILY: \"DNS_EBADFAMILY\",\n BADRESP: \"DNS_EBADRESP\",\n CONNREFUSED: \"DNS_ECONNREFUSED\",\n TIMEOUT: \"DNS_ETIMEOUT\",\n EOF: \"DNS_EEOF\",\n FILE: \"DNS_EFILE\",\n NOMEM: \"DNS_ENOMEM\",\n DESTRUCTION: \"DNS_EDESTRUCTION\",\n BADSTR: \"DNS_EBADSTR\",\n BADFLAGS: \"DNS_EBADFLAGS\",\n NONAME: \"DNS_ENONAME\",\n BADHINTS: \"DNS_EBADHINTS\",\n NOTINITIALIZED: \"DNS_ENOTINITIALIZED\",\n LOADIPHLPAPI: \"DNS_ELOADIPHLPAPI\",\n ADDRGETNETWORKPARAMS: \"DNS_EADDRGETNETWORKPARAMS\",\n CANCELLED: \"DNS_ECANCELLED\",\n lookup,\n lookupService,\n Resolver,\n setServers,\n setDefaultResultOrder,\n resolve,\n reverse,\n resolve4,\n resolve6,\n resolveAny,\n resolveCname,\n resolveCaa,\n resolveMx,\n resolveNs,\n resolvePtr,\n resolveSoa,\n resolveSrv,\n resolveTxt,\n resolveNaptr,\n promises,\n getServers\n};\nreturn $})\n"_s;
//
//
@@ -323,7 +323,7 @@ static constexpr ASCIILiteral NodeDiagnosticsChannelCode = "(function (){\"use s
//
//
-static constexpr ASCIILiteral NodeDNSCode = "(function (){\"use strict\";// src/js/out/tmp/node/dns.ts\nvar getServers = function() {\n return dns.getServers();\n}, lookup = function(domain, options, callback) {\n if (typeof options == \"function\")\n callback = options;\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n if (typeof options == \"number\")\n options = { family: options };\n dns.lookup(domain, options).then((res) => {\n if (res.sort((a, b) => a.family - b.family), options\?.all)\n callback(null, res.map(mapLookupAll));\n else {\n const [{ address, family }] = res;\n callback(null, address, family);\n }\n }, (error) => {\n callback(error);\n });\n}, resolveSrv = function(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveSrv(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n}, resolveTxt = function(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveTxt(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n}, resolveSoa = function(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveSoa(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n}, resolveNaptr = function(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveNaptr(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n}, resolveMx = function(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveMx(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n}, resolveCaa = function(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveCaa(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n}, resolveNs = function(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveNs(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n}, resolvePtr = function(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolvePtr(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n}, resolveCname = function(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveCname(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n}, lookupService = function(address, port, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.lookupService(address, port, callback).then((results) => {\n callback(null, ...results);\n }, (error) => {\n callback(error);\n });\n}, reverse = function(ip, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.reverse(ip, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n}, resolve = function(hostname, rrtype, callback) {\n if (typeof rrtype == \"function\")\n callback = rrtype;\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolve(hostname).then((results) => {\n switch (rrtype\?.toLowerCase()) {\n case \"a\":\n case \"aaaa\":\n callback(null, hostname, results.map(({ address }) => address));\n break;\n default:\n callback(null, results);\n break;\n }\n }, (error) => {\n callback(error);\n });\n}, Resolver = function(options) {\n return new InternalResolver(options);\n}, setDefaultResultOrder = function() {\n}, setServers = function() {\n}, $, dns = Bun.dns, InternalResolver = class Resolver2 {\n constructor(options) {\n }\n cancel() {\n }\n getServers() {\n return [];\n }\n resolve(hostname, rrtype, callback) {\n if (typeof rrtype == \"function\")\n callback = rrtype, rrtype = null;\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolve(hostname).then((results) => {\n switch (rrtype\?.toLowerCase()) {\n case \"a\":\n case \"aaaa\":\n callback(null, hostname, results.map(mapResolveX));\n break;\n default:\n callback(null, results);\n break;\n }\n }, (error) => {\n callback(error);\n });\n }\n resolve4(hostname, options, callback) {\n if (typeof options == \"function\")\n callback = options, options = null;\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.lookup(hostname, { family: 4 }).then((addresses) => {\n callback(null, options\?.ttl \? addresses : addresses.map(mapResolveX));\n }, (error) => {\n callback(error);\n });\n }\n resolve6(hostname, options, callback) {\n if (typeof options == \"function\")\n callback = options, options = null;\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.lookup(hostname, { family: 6 }).then((addresses) => {\n callback(null, options\?.ttl \? addresses : addresses.map(({ address }) => address));\n }, (error) => {\n callback(error);\n });\n }\n resolveAny(hostname, callback) {\n callback(null, []);\n }\n resolveCname(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveCname(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n }\n resolveMx(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveMx(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n }\n resolveNaptr(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveNaptr(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n }\n resolveNs(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveNs(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n }\n resolvePtr(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolvePtr(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n }\n resolveSrv(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveSrv(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n }\n resolveCaa(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveCaa(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n }\n resolveTxt(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveTxt(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n }\n resolveSoa(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveSoa(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n }\n reverse(ip, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.reverse(ip, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n }\n setServers(servers) {\n }\n};\nResolver.prototype = {};\nObject.setPrototypeOf(Resolver.prototype, InternalResolver.prototype);\nObject.setPrototypeOf(Resolver, InternalResolver);\nvar {\n resolve,\n resolve4,\n resolve6,\n resolveAny,\n resolveCname,\n resolveCaa,\n resolveMx,\n resolveNaptr,\n resolveNs,\n resolvePtr,\n resolveSoa,\n resolveSrv,\n reverse,\n resolveTxt\n} = InternalResolver.prototype, promisifyLookup = (res) => {\n res.sort((a, b) => a.family - b.family);\n const [{ address, family }] = res;\n return { address, family };\n}, mapLookupAll = (res) => {\n const { address, family } = res;\n return { address, family };\n}, promisifyLookupAll = (res) => {\n return res.sort((a, b) => a.family - b.family), res.map(mapLookupAll);\n}, mapResolveX = (a) => a.address, promisifyResolveX = (res) => {\n return res\?.map(mapResolveX);\n}, promises = {\n lookup(domain, options) {\n if (options\?.all)\n return dns.lookup(domain, options).then(promisifyLookupAll);\n return dns.lookup(domain, options).then(promisifyLookup);\n },\n lookupService(address, port) {\n return dns.lookupService(address, port);\n },\n resolve(hostname, rrtype) {\n if (typeof rrtype !== \"string\")\n rrtype = null;\n switch (rrtype\?.toLowerCase()) {\n case \"a\":\n case \"aaaa\":\n return dns.resolve(hostname, rrtype).then(promisifyLookup);\n default:\n return dns.resolve(hostname, rrtype);\n }\n },\n resolve4(hostname, options) {\n if (options\?.ttl)\n return dns.lookup(hostname, { family: 4 });\n return dns.lookup(hostname, { family: 4 }).then(promisifyResolveX);\n },\n resolve6(hostname, options) {\n if (options\?.ttl)\n return dns.lookup(hostname, { family: 6 });\n return dns.lookup(hostname, { family: 6 }).then(promisifyResolveX);\n },\n resolveSrv(hostname) {\n return dns.resolveSrv(hostname);\n },\n resolveTxt(hostname) {\n return dns.resolveTxt(hostname);\n },\n resolveSoa(hostname) {\n return dns.resolveSoa(hostname);\n },\n resolveNaptr(hostname) {\n return dns.resolveNaptr(hostname);\n },\n resolveMx(hostname) {\n return dns.resolveMx(hostname);\n },\n resolveCaa(hostname) {\n return dns.resolveCaa(hostname);\n },\n resolveNs(hostname) {\n return dns.resolveNs(hostname);\n },\n resolvePtr(hostname) {\n return dns.resolvePtr(hostname);\n },\n resolveCname(hostname) {\n return dns.resolveCname(hostname);\n },\n reverse(ip) {\n return dns.reverse(ip);\n },\n Resolver: class Resolver3 {\n constructor(options) {\n }\n cancel() {\n }\n getServers() {\n return [];\n }\n resolve(hostname, rrtype) {\n if (typeof rrtype !== \"string\")\n rrtype = null;\n switch (rrtype\?.toLowerCase()) {\n case \"a\":\n case \"aaaa\":\n return dns.resolve(hostname, rrtype).then(promisifyLookup);\n default:\n return dns.resolve(hostname, rrtype);\n }\n }\n resolve4(hostname, options) {\n if (options\?.ttl)\n return dns.lookup(hostname, { family: 4 });\n return dns.lookup(hostname, { family: 4 }).then(promisifyResolveX);\n }\n resolve6(hostname, options) {\n if (options\?.ttl)\n return dns.lookup(hostname, { family: 6 });\n return dns.lookup(hostname, { family: 6 }).then(promisifyResolveX);\n }\n resolveAny(hostname) {\n return @Promise.resolve([]);\n }\n resolveCname(hostname) {\n return dns.resolveCname(hostname);\n }\n resolveMx(hostname) {\n return dns.resolveMx(hostname);\n }\n resolveNaptr(hostname) {\n return dns.resolveNaptr(hostname);\n }\n resolveNs(hostname) {\n return dns.resolveNs(hostname);\n }\n resolvePtr(hostname) {\n return dns.resolvePtr(hostname);\n }\n resolveSoa(hostname) {\n return dns.resolveSoa(hostname);\n }\n resolveSrv(hostname) {\n return dns.resolveSrv(hostname);\n }\n resolveCaa(hostname) {\n return dns.resolveCaa(hostname);\n }\n resolveTxt(hostname) {\n return dns.resolveTxt(hostname);\n }\n reverse(ip) {\n return dns.reverse(ip);\n }\n setServers(servers) {\n }\n }\n};\nfor (let key of [\"resolveAny\"])\n promises[key] = () => @Promise.resolve(@undefined);\n$ = {\n ADDRCONFIG: 0,\n ALL: 1,\n V4MAPPED: 2,\n NODATA: \"DNS_ENODATA\",\n FORMERR: \"DNS_EFORMERR\",\n SERVFAIL: \"DNS_ESERVFAIL\",\n NOTFOUND: \"DNS_ENOTFOUND\",\n NOTIMP: \"DNS_ENOTIMP\",\n REFUSED: \"DNS_EREFUSED\",\n BADQUERY: \"DNS_EBADQUERY\",\n BADNAME: \"DNS_EBADNAME\",\n BADFAMILY: \"DNS_EBADFAMILY\",\n BADRESP: \"DNS_EBADRESP\",\n CONNREFUSED: \"DNS_ECONNREFUSED\",\n TIMEOUT: \"DNS_ETIMEOUT\",\n EOF: \"DNS_EEOF\",\n FILE: \"DNS_EFILE\",\n NOMEM: \"DNS_ENOMEM\",\n DESTRUCTION: \"DNS_EDESTRUCTION\",\n BADSTR: \"DNS_EBADSTR\",\n BADFLAGS: \"DNS_EBADFLAGS\",\n NONAME: \"DNS_ENONAME\",\n BADHINTS: \"DNS_EBADHINTS\",\n NOTINITIALIZED: \"DNS_ENOTINITIALIZED\",\n LOADIPHLPAPI: \"DNS_ELOADIPHLPAPI\",\n ADDRGETNETWORKPARAMS: \"DNS_EADDRGETNETWORKPARAMS\",\n CANCELLED: \"DNS_ECANCELLED\",\n lookup,\n lookupService,\n Resolver,\n setServers,\n setDefaultResultOrder,\n resolve,\n reverse,\n resolve4,\n resolve6,\n resolveAny,\n resolveCname,\n resolveCaa,\n resolveMx,\n resolveNs,\n resolvePtr,\n resolveSoa,\n resolveSrv,\n resolveTxt,\n resolveNaptr,\n promises,\n getServers\n};\nreturn $})\n"_s;
+static constexpr ASCIILiteral NodeDNSCode = "(function (){\"use strict\";// src/js/out/tmp/node/dns.ts\nvar getServers = function() {\n return dns.getServers();\n}, lookup = function(domain, options, callback) {\n if (typeof options == \"function\")\n callback = options;\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n if (typeof options == \"number\")\n options = { family: options };\n const invalidDomainValues = [\n @undefined,\n !1,\n null,\n \"\"\n ];\n if (Number.isNaN(domain) || invalidDomainValues.some((value) => domain === value)) {\n console.warn(`DeprecationWarning: The provided hostname \"${@String(domain)}\" is not a valid hostname, and is supported in the dns module solely for compatibility.`), callback(null, null, 4);\n return;\n }\n dns.lookup(domain, options).then((res) => {\n if (res.sort((a, b) => a.family - b.family), options\?.all)\n callback(null, res.map(mapLookupAll));\n else {\n const [{ address, family }] = res;\n callback(null, address, family);\n }\n }, (error) => {\n callback(error);\n });\n}, resolveSrv = function(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveSrv(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n}, resolveTxt = function(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveTxt(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n}, resolveSoa = function(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveSoa(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n}, resolveNaptr = function(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveNaptr(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n}, resolveMx = function(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveMx(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n}, resolveCaa = function(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveCaa(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n}, resolveNs = function(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveNs(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n}, resolvePtr = function(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolvePtr(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n}, resolveCname = function(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveCname(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n}, lookupService = function(address, port, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.lookupService(address, port, callback).then((results) => {\n callback(null, ...results);\n }, (error) => {\n callback(error);\n });\n}, reverse = function(ip, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.reverse(ip, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n}, resolve = function(hostname, rrtype, callback) {\n if (typeof rrtype == \"function\")\n callback = rrtype;\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolve(hostname).then((results) => {\n switch (rrtype\?.toLowerCase()) {\n case \"a\":\n case \"aaaa\":\n callback(null, hostname, results.map(({ address }) => address));\n break;\n default:\n callback(null, results);\n break;\n }\n }, (error) => {\n callback(error);\n });\n}, Resolver = function(options) {\n return new InternalResolver(options);\n}, setDefaultResultOrder = function() {\n}, setServers = function() {\n}, $, dns = Bun.dns, InternalResolver = class Resolver2 {\n constructor(options) {\n }\n cancel() {\n }\n getServers() {\n return [];\n }\n resolve(hostname, rrtype, callback) {\n if (typeof rrtype == \"function\")\n callback = rrtype, rrtype = null;\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolve(hostname).then((results) => {\n switch (rrtype\?.toLowerCase()) {\n case \"a\":\n case \"aaaa\":\n callback(null, hostname, results.map(mapResolveX));\n break;\n default:\n callback(null, results);\n break;\n }\n }, (error) => {\n callback(error);\n });\n }\n resolve4(hostname, options, callback) {\n if (typeof options == \"function\")\n callback = options, options = null;\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.lookup(hostname, { family: 4 }).then((addresses) => {\n callback(null, options\?.ttl \? addresses : addresses.map(mapResolveX));\n }, (error) => {\n callback(error);\n });\n }\n resolve6(hostname, options, callback) {\n if (typeof options == \"function\")\n callback = options, options = null;\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.lookup(hostname, { family: 6 }).then((addresses) => {\n callback(null, options\?.ttl \? addresses : addresses.map(({ address }) => address));\n }, (error) => {\n callback(error);\n });\n }\n resolveAny(hostname, callback) {\n callback(null, []);\n }\n resolveCname(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveCname(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n }\n resolveMx(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveMx(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n }\n resolveNaptr(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveNaptr(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n }\n resolveNs(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveNs(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n }\n resolvePtr(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolvePtr(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n }\n resolveSrv(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveSrv(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n }\n resolveCaa(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveCaa(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n }\n resolveTxt(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveTxt(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n }\n resolveSoa(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveSoa(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n }\n reverse(ip, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.reverse(ip, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n }\n setServers(servers) {\n }\n};\nResolver.prototype = {};\nObject.setPrototypeOf(Resolver.prototype, InternalResolver.prototype);\nObject.setPrototypeOf(Resolver, InternalResolver);\nvar {\n resolve,\n resolve4,\n resolve6,\n resolveAny,\n resolveCname,\n resolveCaa,\n resolveMx,\n resolveNaptr,\n resolveNs,\n resolvePtr,\n resolveSoa,\n resolveSrv,\n reverse,\n resolveTxt\n} = InternalResolver.prototype, promisifyLookup = (res) => {\n res.sort((a, b) => a.family - b.family);\n const [{ address, family }] = res;\n return { address, family };\n}, mapLookupAll = (res) => {\n const { address, family } = res;\n return { address, family };\n}, promisifyLookupAll = (res) => {\n return res.sort((a, b) => a.family - b.family), res.map(mapLookupAll);\n}, mapResolveX = (a) => a.address, promisifyResolveX = (res) => {\n return res\?.map(mapResolveX);\n}, promises = {\n lookup(domain, options) {\n if (options\?.all)\n return dns.lookup(domain, options).then(promisifyLookupAll);\n return dns.lookup(domain, options).then(promisifyLookup);\n },\n lookupService(address, port) {\n return dns.lookupService(address, port);\n },\n resolve(hostname, rrtype) {\n if (typeof rrtype !== \"string\")\n rrtype = null;\n switch (rrtype\?.toLowerCase()) {\n case \"a\":\n case \"aaaa\":\n return dns.resolve(hostname, rrtype).then(promisifyLookup);\n default:\n return dns.resolve(hostname, rrtype);\n }\n },\n resolve4(hostname, options) {\n if (options\?.ttl)\n return dns.lookup(hostname, { family: 4 });\n return dns.lookup(hostname, { family: 4 }).then(promisifyResolveX);\n },\n resolve6(hostname, options) {\n if (options\?.ttl)\n return dns.lookup(hostname, { family: 6 });\n return dns.lookup(hostname, { family: 6 }).then(promisifyResolveX);\n },\n resolveSrv(hostname) {\n return dns.resolveSrv(hostname);\n },\n resolveTxt(hostname) {\n return dns.resolveTxt(hostname);\n },\n resolveSoa(hostname) {\n return dns.resolveSoa(hostname);\n },\n resolveNaptr(hostname) {\n return dns.resolveNaptr(hostname);\n },\n resolveMx(hostname) {\n return dns.resolveMx(hostname);\n },\n resolveCaa(hostname) {\n return dns.resolveCaa(hostname);\n },\n resolveNs(hostname) {\n return dns.resolveNs(hostname);\n },\n resolvePtr(hostname) {\n return dns.resolvePtr(hostname);\n },\n resolveCname(hostname) {\n return dns.resolveCname(hostname);\n },\n reverse(ip) {\n return dns.reverse(ip);\n },\n Resolver: class Resolver3 {\n constructor(options) {\n }\n cancel() {\n }\n getServers() {\n return [];\n }\n resolve(hostname, rrtype) {\n if (typeof rrtype !== \"string\")\n rrtype = null;\n switch (rrtype\?.toLowerCase()) {\n case \"a\":\n case \"aaaa\":\n return dns.resolve(hostname, rrtype).then(promisifyLookup);\n default:\n return dns.resolve(hostname, rrtype);\n }\n }\n resolve4(hostname, options) {\n if (options\?.ttl)\n return dns.lookup(hostname, { family: 4 });\n return dns.lookup(hostname, { family: 4 }).then(promisifyResolveX);\n }\n resolve6(hostname, options) {\n if (options\?.ttl)\n return dns.lookup(hostname, { family: 6 });\n return dns.lookup(hostname, { family: 6 }).then(promisifyResolveX);\n }\n resolveAny(hostname) {\n return @Promise.resolve([]);\n }\n resolveCname(hostname) {\n return dns.resolveCname(hostname);\n }\n resolveMx(hostname) {\n return dns.resolveMx(hostname);\n }\n resolveNaptr(hostname) {\n return dns.resolveNaptr(hostname);\n }\n resolveNs(hostname) {\n return dns.resolveNs(hostname);\n }\n resolvePtr(hostname) {\n return dns.resolvePtr(hostname);\n }\n resolveSoa(hostname) {\n return dns.resolveSoa(hostname);\n }\n resolveSrv(hostname) {\n return dns.resolveSrv(hostname);\n }\n resolveCaa(hostname) {\n return dns.resolveCaa(hostname);\n }\n resolveTxt(hostname) {\n return dns.resolveTxt(hostname);\n }\n reverse(ip) {\n return dns.reverse(ip);\n }\n setServers(servers) {\n }\n }\n};\nfor (let key of [\"resolveAny\"])\n promises[key] = () => @Promise.resolve(@undefined);\n$ = {\n ADDRCONFIG: 0,\n ALL: 1,\n V4MAPPED: 2,\n NODATA: \"DNS_ENODATA\",\n FORMERR: \"DNS_EFORMERR\",\n SERVFAIL: \"DNS_ESERVFAIL\",\n NOTFOUND: \"DNS_ENOTFOUND\",\n NOTIMP: \"DNS_ENOTIMP\",\n REFUSED: \"DNS_EREFUSED\",\n BADQUERY: \"DNS_EBADQUERY\",\n BADNAME: \"DNS_EBADNAME\",\n BADFAMILY: \"DNS_EBADFAMILY\",\n BADRESP: \"DNS_EBADRESP\",\n CONNREFUSED: \"DNS_ECONNREFUSED\",\n TIMEOUT: \"DNS_ETIMEOUT\",\n EOF: \"DNS_EEOF\",\n FILE: \"DNS_EFILE\",\n NOMEM: \"DNS_ENOMEM\",\n DESTRUCTION: \"DNS_EDESTRUCTION\",\n BADSTR: \"DNS_EBADSTR\",\n BADFLAGS: \"DNS_EBADFLAGS\",\n NONAME: \"DNS_ENONAME\",\n BADHINTS: \"DNS_EBADHINTS\",\n NOTINITIALIZED: \"DNS_ENOTINITIALIZED\",\n LOADIPHLPAPI: \"DNS_ELOADIPHLPAPI\",\n ADDRGETNETWORKPARAMS: \"DNS_EADDRGETNETWORKPARAMS\",\n CANCELLED: \"DNS_ECANCELLED\",\n lookup,\n lookupService,\n Resolver,\n setServers,\n setDefaultResultOrder,\n resolve,\n reverse,\n resolve4,\n resolve6,\n resolveAny,\n resolveCname,\n resolveCaa,\n resolveMx,\n resolveNs,\n resolvePtr,\n resolveSoa,\n resolveSrv,\n resolveTxt,\n resolveNaptr,\n promises,\n getServers\n};\nreturn $})\n"_s;
//
//
@@ -573,7 +573,7 @@ static constexpr ASCIILiteral NodeDiagnosticsChannelCode = "(function (){\"use s
//
//
-static constexpr ASCIILiteral NodeDNSCode = "(function (){\"use strict\";// src/js/out/tmp/node/dns.ts\nvar getServers = function() {\n return dns.getServers();\n}, lookup = function(domain, options, callback) {\n if (typeof options == \"function\")\n callback = options;\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n if (typeof options == \"number\")\n options = { family: options };\n dns.lookup(domain, options).then((res) => {\n if (res.sort((a, b) => a.family - b.family), options\?.all)\n callback(null, res.map(mapLookupAll));\n else {\n const [{ address, family }] = res;\n callback(null, address, family);\n }\n }, (error) => {\n callback(error);\n });\n}, resolveSrv = function(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveSrv(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n}, resolveTxt = function(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveTxt(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n}, resolveSoa = function(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveSoa(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n}, resolveNaptr = function(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveNaptr(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n}, resolveMx = function(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveMx(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n}, resolveCaa = function(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveCaa(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n}, resolveNs = function(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveNs(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n}, resolvePtr = function(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolvePtr(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n}, resolveCname = function(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveCname(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n}, lookupService = function(address, port, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.lookupService(address, port, callback).then((results) => {\n callback(null, ...results);\n }, (error) => {\n callback(error);\n });\n}, reverse = function(ip, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.reverse(ip, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n}, resolve = function(hostname, rrtype, callback) {\n if (typeof rrtype == \"function\")\n callback = rrtype;\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolve(hostname).then((results) => {\n switch (rrtype\?.toLowerCase()) {\n case \"a\":\n case \"aaaa\":\n callback(null, hostname, results.map(({ address }) => address));\n break;\n default:\n callback(null, results);\n break;\n }\n }, (error) => {\n callback(error);\n });\n}, Resolver = function(options) {\n return new InternalResolver(options);\n}, setDefaultResultOrder = function() {\n}, setServers = function() {\n}, $, dns = Bun.dns, InternalResolver = class Resolver2 {\n constructor(options) {\n }\n cancel() {\n }\n getServers() {\n return [];\n }\n resolve(hostname, rrtype, callback) {\n if (typeof rrtype == \"function\")\n callback = rrtype, rrtype = null;\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolve(hostname).then((results) => {\n switch (rrtype\?.toLowerCase()) {\n case \"a\":\n case \"aaaa\":\n callback(null, hostname, results.map(mapResolveX));\n break;\n default:\n callback(null, results);\n break;\n }\n }, (error) => {\n callback(error);\n });\n }\n resolve4(hostname, options, callback) {\n if (typeof options == \"function\")\n callback = options, options = null;\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.lookup(hostname, { family: 4 }).then((addresses) => {\n callback(null, options\?.ttl \? addresses : addresses.map(mapResolveX));\n }, (error) => {\n callback(error);\n });\n }\n resolve6(hostname, options, callback) {\n if (typeof options == \"function\")\n callback = options, options = null;\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.lookup(hostname, { family: 6 }).then((addresses) => {\n callback(null, options\?.ttl \? addresses : addresses.map(({ address }) => address));\n }, (error) => {\n callback(error);\n });\n }\n resolveAny(hostname, callback) {\n callback(null, []);\n }\n resolveCname(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveCname(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n }\n resolveMx(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveMx(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n }\n resolveNaptr(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveNaptr(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n }\n resolveNs(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveNs(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n }\n resolvePtr(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolvePtr(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n }\n resolveSrv(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveSrv(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n }\n resolveCaa(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveCaa(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n }\n resolveTxt(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveTxt(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n }\n resolveSoa(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveSoa(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n }\n reverse(ip, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.reverse(ip, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n }\n setServers(servers) {\n }\n};\nResolver.prototype = {};\nObject.setPrototypeOf(Resolver.prototype, InternalResolver.prototype);\nObject.setPrototypeOf(Resolver, InternalResolver);\nvar {\n resolve,\n resolve4,\n resolve6,\n resolveAny,\n resolveCname,\n resolveCaa,\n resolveMx,\n resolveNaptr,\n resolveNs,\n resolvePtr,\n resolveSoa,\n resolveSrv,\n reverse,\n resolveTxt\n} = InternalResolver.prototype, promisifyLookup = (res) => {\n res.sort((a, b) => a.family - b.family);\n const [{ address, family }] = res;\n return { address, family };\n}, mapLookupAll = (res) => {\n const { address, family } = res;\n return { address, family };\n}, promisifyLookupAll = (res) => {\n return res.sort((a, b) => a.family - b.family), res.map(mapLookupAll);\n}, mapResolveX = (a) => a.address, promisifyResolveX = (res) => {\n return res\?.map(mapResolveX);\n}, promises = {\n lookup(domain, options) {\n if (options\?.all)\n return dns.lookup(domain, options).then(promisifyLookupAll);\n return dns.lookup(domain, options).then(promisifyLookup);\n },\n lookupService(address, port) {\n return dns.lookupService(address, port);\n },\n resolve(hostname, rrtype) {\n if (typeof rrtype !== \"string\")\n rrtype = null;\n switch (rrtype\?.toLowerCase()) {\n case \"a\":\n case \"aaaa\":\n return dns.resolve(hostname, rrtype).then(promisifyLookup);\n default:\n return dns.resolve(hostname, rrtype);\n }\n },\n resolve4(hostname, options) {\n if (options\?.ttl)\n return dns.lookup(hostname, { family: 4 });\n return dns.lookup(hostname, { family: 4 }).then(promisifyResolveX);\n },\n resolve6(hostname, options) {\n if (options\?.ttl)\n return dns.lookup(hostname, { family: 6 });\n return dns.lookup(hostname, { family: 6 }).then(promisifyResolveX);\n },\n resolveSrv(hostname) {\n return dns.resolveSrv(hostname);\n },\n resolveTxt(hostname) {\n return dns.resolveTxt(hostname);\n },\n resolveSoa(hostname) {\n return dns.resolveSoa(hostname);\n },\n resolveNaptr(hostname) {\n return dns.resolveNaptr(hostname);\n },\n resolveMx(hostname) {\n return dns.resolveMx(hostname);\n },\n resolveCaa(hostname) {\n return dns.resolveCaa(hostname);\n },\n resolveNs(hostname) {\n return dns.resolveNs(hostname);\n },\n resolvePtr(hostname) {\n return dns.resolvePtr(hostname);\n },\n resolveCname(hostname) {\n return dns.resolveCname(hostname);\n },\n reverse(ip) {\n return dns.reverse(ip);\n },\n Resolver: class Resolver3 {\n constructor(options) {\n }\n cancel() {\n }\n getServers() {\n return [];\n }\n resolve(hostname, rrtype) {\n if (typeof rrtype !== \"string\")\n rrtype = null;\n switch (rrtype\?.toLowerCase()) {\n case \"a\":\n case \"aaaa\":\n return dns.resolve(hostname, rrtype).then(promisifyLookup);\n default:\n return dns.resolve(hostname, rrtype);\n }\n }\n resolve4(hostname, options) {\n if (options\?.ttl)\n return dns.lookup(hostname, { family: 4 });\n return dns.lookup(hostname, { family: 4 }).then(promisifyResolveX);\n }\n resolve6(hostname, options) {\n if (options\?.ttl)\n return dns.lookup(hostname, { family: 6 });\n return dns.lookup(hostname, { family: 6 }).then(promisifyResolveX);\n }\n resolveAny(hostname) {\n return @Promise.resolve([]);\n }\n resolveCname(hostname) {\n return dns.resolveCname(hostname);\n }\n resolveMx(hostname) {\n return dns.resolveMx(hostname);\n }\n resolveNaptr(hostname) {\n return dns.resolveNaptr(hostname);\n }\n resolveNs(hostname) {\n return dns.resolveNs(hostname);\n }\n resolvePtr(hostname) {\n return dns.resolvePtr(hostname);\n }\n resolveSoa(hostname) {\n return dns.resolveSoa(hostname);\n }\n resolveSrv(hostname) {\n return dns.resolveSrv(hostname);\n }\n resolveCaa(hostname) {\n return dns.resolveCaa(hostname);\n }\n resolveTxt(hostname) {\n return dns.resolveTxt(hostname);\n }\n reverse(ip) {\n return dns.reverse(ip);\n }\n setServers(servers) {\n }\n }\n};\nfor (let key of [\"resolveAny\"])\n promises[key] = () => @Promise.resolve(@undefined);\n$ = {\n ADDRCONFIG: 0,\n ALL: 1,\n V4MAPPED: 2,\n NODATA: \"DNS_ENODATA\",\n FORMERR: \"DNS_EFORMERR\",\n SERVFAIL: \"DNS_ESERVFAIL\",\n NOTFOUND: \"DNS_ENOTFOUND\",\n NOTIMP: \"DNS_ENOTIMP\",\n REFUSED: \"DNS_EREFUSED\",\n BADQUERY: \"DNS_EBADQUERY\",\n BADNAME: \"DNS_EBADNAME\",\n BADFAMILY: \"DNS_EBADFAMILY\",\n BADRESP: \"DNS_EBADRESP\",\n CONNREFUSED: \"DNS_ECONNREFUSED\",\n TIMEOUT: \"DNS_ETIMEOUT\",\n EOF: \"DNS_EEOF\",\n FILE: \"DNS_EFILE\",\n NOMEM: \"DNS_ENOMEM\",\n DESTRUCTION: \"DNS_EDESTRUCTION\",\n BADSTR: \"DNS_EBADSTR\",\n BADFLAGS: \"DNS_EBADFLAGS\",\n NONAME: \"DNS_ENONAME\",\n BADHINTS: \"DNS_EBADHINTS\",\n NOTINITIALIZED: \"DNS_ENOTINITIALIZED\",\n LOADIPHLPAPI: \"DNS_ELOADIPHLPAPI\",\n ADDRGETNETWORKPARAMS: \"DNS_EADDRGETNETWORKPARAMS\",\n CANCELLED: \"DNS_ECANCELLED\",\n lookup,\n lookupService,\n Resolver,\n setServers,\n setDefaultResultOrder,\n resolve,\n reverse,\n resolve4,\n resolve6,\n resolveAny,\n resolveCname,\n resolveCaa,\n resolveMx,\n resolveNs,\n resolvePtr,\n resolveSoa,\n resolveSrv,\n resolveTxt,\n resolveNaptr,\n promises,\n getServers\n};\nreturn $})\n"_s;
+static constexpr ASCIILiteral NodeDNSCode = "(function (){\"use strict\";// src/js/out/tmp/node/dns.ts\nvar getServers = function() {\n return dns.getServers();\n}, lookup = function(domain, options, callback) {\n if (typeof options == \"function\")\n callback = options;\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n if (typeof options == \"number\")\n options = { family: options };\n const invalidDomainValues = [\n @undefined,\n !1,\n null,\n \"\"\n ];\n if (Number.isNaN(domain) || invalidDomainValues.some((value) => domain === value)) {\n console.warn(`DeprecationWarning: The provided hostname \"${@String(domain)}\" is not a valid hostname, and is supported in the dns module solely for compatibility.`), callback(null, null, 4);\n return;\n }\n dns.lookup(domain, options).then((res) => {\n if (res.sort((a, b) => a.family - b.family), options\?.all)\n callback(null, res.map(mapLookupAll));\n else {\n const [{ address, family }] = res;\n callback(null, address, family);\n }\n }, (error) => {\n callback(error);\n });\n}, resolveSrv = function(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveSrv(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n}, resolveTxt = function(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveTxt(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n}, resolveSoa = function(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveSoa(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n}, resolveNaptr = function(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveNaptr(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n}, resolveMx = function(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveMx(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n}, resolveCaa = function(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveCaa(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n}, resolveNs = function(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveNs(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n}, resolvePtr = function(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolvePtr(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n}, resolveCname = function(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveCname(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n}, lookupService = function(address, port, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.lookupService(address, port, callback).then((results) => {\n callback(null, ...results);\n }, (error) => {\n callback(error);\n });\n}, reverse = function(ip, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.reverse(ip, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n}, resolve = function(hostname, rrtype, callback) {\n if (typeof rrtype == \"function\")\n callback = rrtype;\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolve(hostname).then((results) => {\n switch (rrtype\?.toLowerCase()) {\n case \"a\":\n case \"aaaa\":\n callback(null, hostname, results.map(({ address }) => address));\n break;\n default:\n callback(null, results);\n break;\n }\n }, (error) => {\n callback(error);\n });\n}, Resolver = function(options) {\n return new InternalResolver(options);\n}, setDefaultResultOrder = function() {\n}, setServers = function() {\n}, $, dns = Bun.dns, InternalResolver = class Resolver2 {\n constructor(options) {\n }\n cancel() {\n }\n getServers() {\n return [];\n }\n resolve(hostname, rrtype, callback) {\n if (typeof rrtype == \"function\")\n callback = rrtype, rrtype = null;\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolve(hostname).then((results) => {\n switch (rrtype\?.toLowerCase()) {\n case \"a\":\n case \"aaaa\":\n callback(null, hostname, results.map(mapResolveX));\n break;\n default:\n callback(null, results);\n break;\n }\n }, (error) => {\n callback(error);\n });\n }\n resolve4(hostname, options, callback) {\n if (typeof options == \"function\")\n callback = options, options = null;\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.lookup(hostname, { family: 4 }).then((addresses) => {\n callback(null, options\?.ttl \? addresses : addresses.map(mapResolveX));\n }, (error) => {\n callback(error);\n });\n }\n resolve6(hostname, options, callback) {\n if (typeof options == \"function\")\n callback = options, options = null;\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.lookup(hostname, { family: 6 }).then((addresses) => {\n callback(null, options\?.ttl \? addresses : addresses.map(({ address }) => address));\n }, (error) => {\n callback(error);\n });\n }\n resolveAny(hostname, callback) {\n callback(null, []);\n }\n resolveCname(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveCname(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n }\n resolveMx(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveMx(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n }\n resolveNaptr(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveNaptr(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n }\n resolveNs(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveNs(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n }\n resolvePtr(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolvePtr(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n }\n resolveSrv(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveSrv(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n }\n resolveCaa(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveCaa(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n }\n resolveTxt(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveTxt(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n }\n resolveSoa(hostname, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.resolveSoa(hostname, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n }\n reverse(ip, callback) {\n if (typeof callback != \"function\")\n @throwTypeError(\"callback must be a function\");\n dns.reverse(ip, callback).then((results) => {\n callback(null, results);\n }, (error) => {\n callback(error);\n });\n }\n setServers(servers) {\n }\n};\nResolver.prototype = {};\nObject.setPrototypeOf(Resolver.prototype, InternalResolver.prototype);\nObject.setPrototypeOf(Resolver, InternalResolver);\nvar {\n resolve,\n resolve4,\n resolve6,\n resolveAny,\n resolveCname,\n resolveCaa,\n resolveMx,\n resolveNaptr,\n resolveNs,\n resolvePtr,\n resolveSoa,\n resolveSrv,\n reverse,\n resolveTxt\n} = InternalResolver.prototype, promisifyLookup = (res) => {\n res.sort((a, b) => a.family - b.family);\n const [{ address, family }] = res;\n return { address, family };\n}, mapLookupAll = (res) => {\n const { address, family } = res;\n return { address, family };\n}, promisifyLookupAll = (res) => {\n return res.sort((a, b) => a.family - b.family), res.map(mapLookupAll);\n}, mapResolveX = (a) => a.address, promisifyResolveX = (res) => {\n return res\?.map(mapResolveX);\n}, promises = {\n lookup(domain, options) {\n if (options\?.all)\n return dns.lookup(domain, options).then(promisifyLookupAll);\n return dns.lookup(domain, options).then(promisifyLookup);\n },\n lookupService(address, port) {\n return dns.lookupService(address, port);\n },\n resolve(hostname, rrtype) {\n if (typeof rrtype !== \"string\")\n rrtype = null;\n switch (rrtype\?.toLowerCase()) {\n case \"a\":\n case \"aaaa\":\n return dns.resolve(hostname, rrtype).then(promisifyLookup);\n default:\n return dns.resolve(hostname, rrtype);\n }\n },\n resolve4(hostname, options) {\n if (options\?.ttl)\n return dns.lookup(hostname, { family: 4 });\n return dns.lookup(hostname, { family: 4 }).then(promisifyResolveX);\n },\n resolve6(hostname, options) {\n if (options\?.ttl)\n return dns.lookup(hostname, { family: 6 });\n return dns.lookup(hostname, { family: 6 }).then(promisifyResolveX);\n },\n resolveSrv(hostname) {\n return dns.resolveSrv(hostname);\n },\n resolveTxt(hostname) {\n return dns.resolveTxt(hostname);\n },\n resolveSoa(hostname) {\n return dns.resolveSoa(hostname);\n },\n resolveNaptr(hostname) {\n return dns.resolveNaptr(hostname);\n },\n resolveMx(hostname) {\n return dns.resolveMx(hostname);\n },\n resolveCaa(hostname) {\n return dns.resolveCaa(hostname);\n },\n resolveNs(hostname) {\n return dns.resolveNs(hostname);\n },\n resolvePtr(hostname) {\n return dns.resolvePtr(hostname);\n },\n resolveCname(hostname) {\n return dns.resolveCname(hostname);\n },\n reverse(ip) {\n return dns.reverse(ip);\n },\n Resolver: class Resolver3 {\n constructor(options) {\n }\n cancel() {\n }\n getServers() {\n return [];\n }\n resolve(hostname, rrtype) {\n if (typeof rrtype !== \"string\")\n rrtype = null;\n switch (rrtype\?.toLowerCase()) {\n case \"a\":\n case \"aaaa\":\n return dns.resolve(hostname, rrtype).then(promisifyLookup);\n default:\n return dns.resolve(hostname, rrtype);\n }\n }\n resolve4(hostname, options) {\n if (options\?.ttl)\n return dns.lookup(hostname, { family: 4 });\n return dns.lookup(hostname, { family: 4 }).then(promisifyResolveX);\n }\n resolve6(hostname, options) {\n if (options\?.ttl)\n return dns.lookup(hostname, { family: 6 });\n return dns.lookup(hostname, { family: 6 }).then(promisifyResolveX);\n }\n resolveAny(hostname) {\n return @Promise.resolve([]);\n }\n resolveCname(hostname) {\n return dns.resolveCname(hostname);\n }\n resolveMx(hostname) {\n return dns.resolveMx(hostname);\n }\n resolveNaptr(hostname) {\n return dns.resolveNaptr(hostname);\n }\n resolveNs(hostname) {\n return dns.resolveNs(hostname);\n }\n resolvePtr(hostname) {\n return dns.resolvePtr(hostname);\n }\n resolveSoa(hostname) {\n return dns.resolveSoa(hostname);\n }\n resolveSrv(hostname) {\n return dns.resolveSrv(hostname);\n }\n resolveCaa(hostname) {\n return dns.resolveCaa(hostname);\n }\n resolveTxt(hostname) {\n return dns.resolveTxt(hostname);\n }\n reverse(ip) {\n return dns.reverse(ip);\n }\n setServers(servers) {\n }\n }\n};\nfor (let key of [\"resolveAny\"])\n promises[key] = () => @Promise.resolve(@undefined);\n$ = {\n ADDRCONFIG: 0,\n ALL: 1,\n V4MAPPED: 2,\n NODATA: \"DNS_ENODATA\",\n FORMERR: \"DNS_EFORMERR\",\n SERVFAIL: \"DNS_ESERVFAIL\",\n NOTFOUND: \"DNS_ENOTFOUND\",\n NOTIMP: \"DNS_ENOTIMP\",\n REFUSED: \"DNS_EREFUSED\",\n BADQUERY: \"DNS_EBADQUERY\",\n BADNAME: \"DNS_EBADNAME\",\n BADFAMILY: \"DNS_EBADFAMILY\",\n BADRESP: \"DNS_EBADRESP\",\n CONNREFUSED: \"DNS_ECONNREFUSED\",\n TIMEOUT: \"DNS_ETIMEOUT\",\n EOF: \"DNS_EEOF\",\n FILE: \"DNS_EFILE\",\n NOMEM: \"DNS_ENOMEM\",\n DESTRUCTION: \"DNS_EDESTRUCTION\",\n BADSTR: \"DNS_EBADSTR\",\n BADFLAGS: \"DNS_EBADFLAGS\",\n NONAME: \"DNS_ENONAME\",\n BADHINTS: \"DNS_EBADHINTS\",\n NOTINITIALIZED: \"DNS_ENOTINITIALIZED\",\n LOADIPHLPAPI: \"DNS_ELOADIPHLPAPI\",\n ADDRGETNETWORKPARAMS: \"DNS_EADDRGETNETWORKPARAMS\",\n CANCELLED: \"DNS_ECANCELLED\",\n lookup,\n lookupService,\n Resolver,\n setServers,\n setDefaultResultOrder,\n resolve,\n reverse,\n resolve4,\n resolve6,\n resolveAny,\n resolveCname,\n resolveCaa,\n resolveMx,\n resolveNs,\n resolvePtr,\n resolveSoa,\n resolveSrv,\n resolveTxt,\n resolveNaptr,\n promises,\n getServers\n};\nreturn $})\n"_s;
//
//
diff --git a/test/js/node/dns/node-dns.test.js b/test/js/node/dns/node-dns.test.js
index d549017b2..900c6b52d 100644
--- a/test/js/node/dns/node-dns.test.js
+++ b/test/js/node/dns/node-dns.test.js
@@ -394,3 +394,20 @@ describe("dns.lookupService", () => {
expect(service).toStrictEqual(expected[1]);
});
});
+
+// Deprecated reference: https://nodejs.org/api/deprecations.html#DEP0118
+describe("lookup deprecated behavior", () => {
+ it.each([
+ undefined,
+ false,
+ null,
+ NaN,
+ ""
+ ])("dns.lookup", domain => {
+ dns.lookup(domain, (error, address, family) => {
+ expect(error).toBeNull();
+ expect(address).toBeNull();
+ expect(family).toBe(4);
+ });
+ });
+}); \ No newline at end of file