mirror of
https://github.com/oven-sh/bun
synced 2026-02-09 18:38:55 +00:00
allow bun add of packages with capital letters (#2095)
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user