diff options
author | 2022-12-17 12:16:39 -0800 | |
---|---|---|
committer | 2022-12-17 12:26:19 -0800 | |
commit | 8c8accf968e4e108a6fcdaf4158440886cf476d8 (patch) | |
tree | 98db842a2c99d0fa06c84b0da7d7bd3d7f5dac07 /src/bun.js/module_loader.zig | |
parent | 24be0f4fc5c7f8e28021c0827c4c5b0f5f8493e6 (diff) | |
download | bun-8c8accf968e4e108a6fcdaf4158440886cf476d8.tar.gz bun-8c8accf968e4e108a6fcdaf4158440886cf476d8.tar.zst bun-8c8accf968e4e108a6fcdaf4158440886cf476d8.zip |
Use `Buffer.isBuffer` and node:util/types in `util` module
Diffstat (limited to 'src/bun.js/module_loader.zig')
-rw-r--r-- | src/bun.js/module_loader.zig | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/bun.js/module_loader.zig b/src/bun.js/module_loader.zig index f36884014..85db973ce 100644 --- a/src/bun.js/module_loader.zig +++ b/src/bun.js/module_loader.zig @@ -1810,6 +1810,17 @@ pub const ModuleLoader = struct { .hash = 0, }; }, + .@"node:util" => { + return ResolvedSource{ + .allocator = null, + .source_code = ZigString.init( + @as(string, jsModuleFromFile(jsc_vm.load_builtins_from_path, "./util.exports.js")), + ), + .specifier = ZigString.init("node:util"), + .source_url = ZigString.init("node:util"), + .hash = 0, + }; + }, .@"undici" => { return ResolvedSource{ .allocator = null, @@ -1985,6 +1996,7 @@ pub const HardcodedModule = enum { @"node:timers/promises", @"node:tty", @"node:url", + @"node:util", @"node:util/types", @"undici", @"ws", @@ -2026,6 +2038,7 @@ pub const HardcodedModule = enum { .{ "node:timers/promises", HardcodedModule.@"node:timers/promises" }, .{ "node:tty", HardcodedModule.@"node:tty" }, .{ "node:url", HardcodedModule.@"node:url" }, + .{ "node:util", HardcodedModule.@"node:util" }, .{ "node:util/types", HardcodedModule.@"node:util/types" }, .{ "undici", HardcodedModule.@"undici" }, .{ "ws", HardcodedModule.@"ws" }, @@ -2036,11 +2049,11 @@ pub const HardcodedModule = enum { .{ .{ "assert", "node:assert" }, .{ "buffer", "node:buffer" }, + .{ "bun", "bun" }, .{ "bun:ffi", "bun:ffi" }, .{ "bun:jsc", "bun:jsc" }, .{ "bun:sqlite", "bun:sqlite" }, .{ "bun:wrap", "bun:wrap" }, - .{ "bun", "bun" }, .{ "child_process", "node:child_process" }, .{ "depd", "depd" }, .{ "detect-libc", "detect-libc" }, @@ -2078,6 +2091,7 @@ pub const HardcodedModule = enum { .{ "node:tty", "node:tty" }, .{ "node:url", "node:url" }, .{ "node:util", "node:util" }, + .{ "node:util/types", "node:util/types" }, .{ "os", "node:os" }, .{ "path", "node:path" }, .{ "path/posix", "node:path/posix" }, @@ -2097,6 +2111,7 @@ pub const HardcodedModule = enum { .{ "undici", "undici" }, .{ "url", "node:url" }, .{ "util", "node:util" }, + .{ "util/types", "node:util/types" }, .{ "ws", "ws" }, .{ "ws/lib/websocket", "ws" }, }, |