diff --git a/src/install/lockfile/Package/Meta.zig b/src/install/lockfile/Package/Meta.zig index ed0cf15bf9..8f66c77726 100644 --- a/src/install/lockfile/Package/Meta.zig +++ b/src/install/lockfile/Package/Meta.zig @@ -9,7 +9,7 @@ pub const Meta = extern struct { arch: Npm.Architecture = .all, os: Npm.OperatingSystem = .all, - libc: Npm.Libc = .all, + libc: Npm.Libc = .none, _padding_after_platform: u8 = 0, id: PackageID = invalid_package_id, diff --git a/src/install/lockfile/lockfile_json_stringify_for_debugging.zig b/src/install/lockfile/lockfile_json_stringify_for_debugging.zig index a4c5918702..bf0f9b2e2d 100644 --- a/src/install/lockfile/lockfile_json_stringify_for_debugging.zig +++ b/src/install/lockfile/lockfile_json_stringify_for_debugging.zig @@ -313,7 +313,7 @@ pub fn jsonStringify(this: *const Lockfile, w: anytype) !void { } } - if (@as(u16, @intFromEnum(pkg.meta.libc)) != Npm.Libc.all_value) { + if (pkg.meta.libc != .none) { try w.objectField("libc"); try w.beginArray(); defer w.endArray() catch {}; diff --git a/src/install/npm.zig b/src/install/npm.zig index c39245430b..be3331a9ec 100644 --- a/src/install/npm.zig +++ b/src/install/npm.zig @@ -783,15 +783,15 @@ pub const Libc = enum(u8) { } pub fn isMatch(this: Libc) bool { - return (@intFromEnum(this) & @intFromEnum(current)) != 0 or this == .none; + return (@intFromEnum(this) & @intFromEnum(current)) != 0; } pub fn isMatchWithTarget(this: Libc, target: Libc) bool { - return (@intFromEnum(this) & @intFromEnum(target)) != 0 or this == .none; + return (@intFromEnum(this) & @intFromEnum(target)) != 0; } pub fn negatable(this: Libc) Negatable(Libc) { - return .{ .added = this, .removed = .none }; + return .{ .added = .none, .removed = this }; } pub const current: Libc = switch (Environment.os) {