diff options
Diffstat (limited to 'src/import_record.zig')
-rw-r--r-- | src/import_record.zig | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/import_record.zig b/src/import_record.zig index b160befe0..89c439604 100644 --- a/src/import_record.zig +++ b/src/import_record.zig @@ -170,6 +170,10 @@ pub const ImportRecord = struct { return this.flags.contains(.was_originally_require); } + pub inline fn is_external_without_side_effects(this: *const ImportRecord) bool { + return @enumToInt(this.tag) >= @enumToInt(Tag.bun) or this.flags.contains(.is_external_without_side_effects); + } + pub const Flags = enum { /// True for the following cases: /// @@ -219,6 +223,8 @@ pub const ImportRecord = struct { was_originally_require, + is_external_without_side_effects, + pub const None = Set{}; pub const Fields = std.enums.EnumFieldStruct(Flags, bool, false); pub const Set = std.enums.EnumSet(Flags); |