diff options
author | 2021-09-24 16:41:45 -0700 | |
---|---|---|
committer | 2021-09-24 16:41:45 -0700 | |
commit | 940570af5904b35784e24f7ea35ccc1fa1f260e7 (patch) | |
tree | 26ce1c7e08303040e0f5a23fdb04ed9d5756a415 /src/options.zig | |
parent | bdfb5a91b14a129df1b1a5d46aae5c8ef2ea2fd8 (diff) | |
download | bun-940570af5904b35784e24f7ea35ccc1fa1f260e7.tar.gz bun-940570af5904b35784e24f7ea35ccc1fa1f260e7.tar.zst bun-940570af5904b35784e24f7ea35ccc1fa1f260e7.zip |
skeleton codebun-v0.0.22
Diffstat (limited to 'src/options.zig')
-rw-r--r-- | src/options.zig | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/src/options.zig b/src/options.zig index 78c302807..af574ca1d 100644 --- a/src/options.zig +++ b/src/options.zig @@ -338,18 +338,33 @@ pub const Platform = enum { neutral, browser, bun, + bun_macro, node, + pub inline fn isBun(this: Platform) bool { + return switch (this) { + .bun_macro, .bun => true, + else => false, + }; + } + + pub inline fn isNotBun(this: Platform) bool { + return switch (this) { + .bun_macro, .bun => false, + else => true, + }; + } + pub inline fn isClient(this: Platform) bool { return switch (this) { - .bun => false, + .bun_macro, .bun => false, else => true, }; } pub inline fn supportsBrowserField(this: Platform) bool { return switch (this) { - .neutral, .browser, .bun => true, + .bun_macro, .neutral, .browser, .bun => true, else => false, }; } @@ -360,7 +375,7 @@ pub const Platform = enum { pub inline fn processBrowserDefineValue(this: Platform) ?string { return switch (this) { .browser => browser_define_value_true, - .bun, .node => browser_define_value_false, + .bun_macro, .bun, .node => browser_define_value_false, else => null, }; } |