aboutsummaryrefslogtreecommitdiff
path: root/src/bun.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/bun.js')
-rw-r--r--src/bun.js/api/server.zig2
-rw-r--r--src/bun.js/node-dns.exports.js43
-rw-r--r--src/bun.js/node-tls.exports.js1
-rw-r--r--src/bun.js/wasi-runner.js11
4 files changed, 20 insertions, 37 deletions
diff --git a/src/bun.js/api/server.zig b/src/bun.js/api/server.zig
index 0ecd684bd..bb2f251a2 100644
--- a/src/bun.js/api/server.zig
+++ b/src/bun.js/api/server.zig
@@ -1877,7 +1877,7 @@ fn NewRequestContext(comptime ssl_enabled: bool, comptime debug_mode: bool, comp
resp.body.value = .{ .Used = {} };
}
}
-
+
streamLog("onResolve({any})", .{wrote_anything});
//aborted so call finalizeForAbort
diff --git a/src/bun.js/node-dns.exports.js b/src/bun.js/node-dns.exports.js
index 025728eb6..f7516923a 100644
--- a/src/bun.js/node-dns.exports.js
+++ b/src/bun.js/node-dns.exports.js
@@ -169,9 +169,9 @@ function lookupService(address, port, callback) {
}
var InternalResolver = class Resolver {
- constructor(options) { }
+ constructor(options) {}
- cancel() { }
+ cancel() {}
getServers() {
return [];
@@ -192,11 +192,7 @@ var InternalResolver = class Resolver {
switch (rrtype?.toLowerCase()) {
case "a":
case "aaaa":
- callback(
- null,
- hostname,
- results.map(mapResolveX),
- );
+ callback(null, hostname, results.map(mapResolveX));
break;
default:
callback(null, results);
@@ -221,10 +217,7 @@ var InternalResolver = class Resolver {
dns.lookup(hostname, { family: 4 }).then(
addresses => {
- callback(
- null,
- options?.ttl ? addresses : addresses.map(mapResolveX),
- );
+ callback(null, options?.ttl ? addresses : addresses.map(mapResolveX));
},
error => {
callback(error);
@@ -244,10 +237,7 @@ var InternalResolver = class Resolver {
dns.lookup(hostname, { family: 6 }).then(
addresses => {
- callback(
- null,
- options?.ttl ? addresses : addresses.map(({ address }) => address),
- );
+ callback(null, options?.ttl ? addresses : addresses.map(({ address }) => address));
},
error => {
callback(error);
@@ -397,7 +387,7 @@ var InternalResolver = class Resolver {
callback(null, []);
}
- setServers(servers) { }
+ setServers(servers) {}
};
function resolve(hostname, rrtype, callback) {
@@ -454,8 +444,8 @@ export var {
resolveTxt,
} = InternalResolver.prototype;
-function setDefaultResultOrder() { }
-function setServers() { }
+function setDefaultResultOrder() {}
+function setServers() {}
const promisifyLookup = res => {
res.sort((a, b) => a.family - b.family);
@@ -467,8 +457,7 @@ const mapResolveX = a => a.address;
const promisifyResolveX = res => {
return res?.map(mapResolveX);
-}
-
+};
// promisified versions
export const promises = {
@@ -497,14 +486,14 @@ export const promises = {
if (options?.ttl) {
return dns.lookup(hostname, { family: 4 });
}
- return dns.lookup(hostname, { family: 4 }).then(promisifyResolveX)
+ return dns.lookup(hostname, { family: 4 }).then(promisifyResolveX);
},
resolve6(hostname, options) {
if (options?.ttl) {
return dns.lookup(hostname, { family: 6 });
}
- return dns.lookup(hostname, { family: 6 }).then(promisifyResolveX)
+ return dns.lookup(hostname, { family: 6 }).then(promisifyResolveX);
},
resolveSrv(hostname) {
@@ -537,9 +526,9 @@ export const promises = {
},
Resolver: class Resolver {
- constructor(options) { }
+ constructor(options) {}
- cancel() { }
+ cancel() {}
getServers() {
return [];
@@ -562,14 +551,14 @@ export const promises = {
if (options?.ttl) {
return dns.lookup(hostname, { family: 4 });
}
- return dns.lookup(hostname, { family: 4 }).then(promisifyResolveX)
+ return dns.lookup(hostname, { family: 4 }).then(promisifyResolveX);
}
resolve6(hostname, options) {
if (options?.ttl) {
return dns.lookup(hostname, { family: 6 });
}
- return dns.lookup(hostname, { family: 6 }).then(promisifyResolveX)
+ return dns.lookup(hostname, { family: 6 }).then(promisifyResolveX);
}
resolveAny(hostname) {
@@ -616,7 +605,7 @@ export const promises = {
return Promise.resolve([]);
}
- setServers(servers) { }
+ setServers(servers) {}
},
};
for (const key of ["resolveAny", "reverse"]) {
diff --git a/src/bun.js/node-tls.exports.js b/src/bun.js/node-tls.exports.js
index 74a64cca4..46301ae77 100644
--- a/src/bun.js/node-tls.exports.js
+++ b/src/bun.js/node-tls.exports.js
@@ -154,4 +154,5 @@ var exports = {
};
export default exports;
+
export { createSecureContext, parseCertString, TLSSocket, SecureContext };
diff --git a/src/bun.js/wasi-runner.js b/src/bun.js/wasi-runner.js
index 24ff0a678..6a89510b1 100644
--- a/src/bun.js/wasi-runner.js
+++ b/src/bun.js/wasi-runner.js
@@ -3,21 +3,14 @@
const filePath = process.argv.at(1);
if (!filePath) {
- var err = new Error(
- "To run a wasm file with Bun, the first argument must be a path to a .wasm file",
- );
+ var err = new Error("To run a wasm file with Bun, the first argument must be a path to a .wasm file");
err.name = "WasmFileNotFound";
throw err;
}
// The module specifier is the resolved path to the wasm file
-var {
- WASM_CWD = process.cwd(),
- WASM_ROOT_DIR = "/",
- WASM_ENV_STR = undefined,
- WASM_USE_ASYNC_INIT = "",
-} = process.env;
+var { WASM_CWD = process.cwd(), WASM_ROOT_DIR = "/", WASM_ENV_STR = undefined, WASM_USE_ASYNC_INIT = "" } = process.env;
var env = process.env;
if (WASM_ENV_STR?.length) {