aboutsummaryrefslogtreecommitdiff
path: root/src/install/dependency.zig
diff options
context:
space:
mode:
authorGravatar Alex Lam S.L <alexlamsl@gmail.com> 2023-01-10 15:35:20 +0200
committerGravatar GitHub <noreply@github.com> 2023-01-10 05:35:20 -0800
commit270b07e85e82b46491cc713fb2a5bb973d3de4f6 (patch)
treeb8071eaf835f2aefb8ee95c68f9002d84b7b5761 /src/install/dependency.zig
parentb458abedbb865461005757cac5ea2b458249ef25 (diff)
downloadbun-270b07e85e82b46491cc713fb2a5bb973d3de4f6.tar.gz
bun-270b07e85e82b46491cc713fb2a5bb973d3de4f6.tar.zst
bun-270b07e85e82b46491cc713fb2a5bb973d3de4f6.zip
use `strings.hasPrefixComptime()` (#1755)
Diffstat (limited to 'src/install/dependency.zig')
-rw-r--r--src/install/dependency.zig4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/install/dependency.zig b/src/install/dependency.zig
index 73eeb4264..e85d7cb85 100644
--- a/src/install/dependency.zig
+++ b/src/install/dependency.zig
@@ -311,7 +311,7 @@ pub const Version = struct {
},
'n' => {
- if (dependency.len > 4 and strings.eqlComptimeIgnoreLen(dependency[0..4], "npm:")) {
+ if (strings.hasPrefixComptime(dependency, "npm:")) {
return Tag.npm;
}
},
@@ -536,7 +536,7 @@ pub fn parse(
if (dependency.len == 0) return null;
const tag = Version.Tag.infer(dependency);
- if (tag == .npm and dependency.len > 4 and strings.eqlComptimeIgnoreLen(dependency[0..4], "npm:")) {
+ if (tag == .npm and strings.hasPrefixComptime(dependency, "npm:")) {
dependency = dependency[4..];
}