aboutsummaryrefslogtreecommitdiff
path: root/src/install/semver.zig
diff options
context:
space:
mode:
authorGravatar Alex Lam S.L <alexlamsl@gmail.com> 2023-02-09 00:37:14 +0200
committerGravatar GitHub <noreply@github.com> 2023-02-08 14:37:14 -0800
commit18807cef03ac83a6a3dabded7a9735b87792f52e (patch)
treed40b8968840d16a7e1a96695b46e5415b3c4176a /src/install/semver.zig
parentcbc28afd51547f7a90161741cf826ee7f1485ae6 (diff)
downloadbun-18807cef03ac83a6a3dabded7a9735b87792f52e.tar.gz
bun-18807cef03ac83a6a3dabded7a9735b87792f52e.tar.zst
bun-18807cef03ac83a6a3dabded7a9735b87792f52e.zip
[install] assorted fixes & improvements (#2011)
- take `peerDependencies` into account during package placement - do not recursively resolve `workspaces` (matches `npm`) - link binaries to non-root packages correctly - prune empty nodes during dependency tree construction - support non-standard `workspace:` specifier
Diffstat (limited to 'src/install/semver.zig')
-rw-r--r--src/install/semver.zig4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/install/semver.zig b/src/install/semver.zig
index c4d9b5b5f..f9e16968f 100644
--- a/src/install/semver.zig
+++ b/src/install/semver.zig
@@ -577,13 +577,13 @@ pub const SlicedString = struct {
}
pub inline fn external(this: SlicedString) ExternalString {
- if (comptime Environment.isDebug or Environment.isTest) std.debug.assert(@ptrToInt(this.buf.ptr) <= @ptrToInt(this.slice.ptr) and ((@ptrToInt(this.slice.ptr) + this.slice.len) <= (@ptrToInt(this.buf.ptr) + this.buf.len)));
+ if (comptime Environment.allow_assert) std.debug.assert(@ptrToInt(this.buf.ptr) <= @ptrToInt(this.slice.ptr) and ((@ptrToInt(this.slice.ptr) + this.slice.len) <= (@ptrToInt(this.buf.ptr) + this.buf.len)));
return ExternalString.init(this.buf, this.slice, std.hash.Wyhash.hash(0, this.slice));
}
pub inline fn value(this: SlicedString) String {
- if (comptime Environment.isDebug or Environment.isTest) std.debug.assert(@ptrToInt(this.buf.ptr) <= @ptrToInt(this.slice.ptr) and ((@ptrToInt(this.slice.ptr) + this.slice.len) <= (@ptrToInt(this.buf.ptr) + this.buf.len)));
+ if (comptime Environment.allow_assert) std.debug.assert(@ptrToInt(this.buf.ptr) <= @ptrToInt(this.slice.ptr) and ((@ptrToInt(this.slice.ptr) + this.slice.len) <= (@ptrToInt(this.buf.ptr) + this.buf.len)));
return String.init(this.buf, this.slice);
}