diff options
author | 2023-02-18 00:46:07 +0200 | |
---|---|---|
committer | 2023-02-17 14:46:07 -0800 | |
commit | 79f7d29d034586b352a44a71bd10ffc47112545f (patch) | |
tree | e4c5e05d503776e7daaa341b9d7a54788e945312 /src/string_immutable.zig | |
parent | 56b75dbac32233b49b33c12ce25a07c9e9083dee (diff) | |
download | bun-79f7d29d034586b352a44a71bd10ffc47112545f.tar.gz bun-79f7d29d034586b352a44a71bd10ffc47112545f.tar.zst bun-79f7d29d034586b352a44a71bd10ffc47112545f.zip |
allow `bun add` of packages with capital letters (#2095)
Diffstat (limited to 'src/string_immutable.zig')
-rw-r--r-- | src/string_immutable.zig | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/string_immutable.zig b/src/string_immutable.zig index 5f5b943d6..869235fcb 100644 --- a/src/string_immutable.zig +++ b/src/string_immutable.zig @@ -94,13 +94,15 @@ pub inline fn isNPMPackageName(target: string) bool { if (target.len > 214) return false; const scoped = switch (target[0]) { - 'a'...'z', '0'...'9', '$', '-' => false, + // Old packages may have capital letters + 'A'...'Z', 'a'...'z', '0'...'9', '$', '-' => false, '@' => true, else => return false, }; var slash_index: usize = 0; for (target[1..]) |c, i| { switch (c) { + // Old packages may have capital letters 'A'...'Z', 'a'...'z', '0'...'9', '$', '-', '_', '.' => {}, '/' => { if (!scoped) return false; |