Skip to content

Commit

Permalink
#5246:removing the leading underscore restriction in the package naming.
Browse files Browse the repository at this point in the history
  • Loading branch information
raj-meka committed Apr 23, 2024
1 parent 7bbbb96 commit b2b3cfe
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
2 changes: 1 addition & 1 deletion npm_and_yarn/lib/dependabot/npm_and_yarn/package_name.rb
Expand Up @@ -19,7 +19,7 @@ class PackageName
[a-z0-9\-\_\.\!\~\*\'\(\)]+ # URL-safe characters
)\/)?
(?<name> # capture package name
(?=[^\.\_]) # reject leading dot or underscore
(?=[^\.]) # reject leading dot or underscore
[a-z0-9\-\_\.\!\~\*\'\(\)]+ # URL-safe characters
)
\z # end of string
Expand Down
Expand Up @@ -19,7 +19,6 @@
it "raises an error for invalid package names" do
expect { described_class.new("") }.to raise_error(described_class::InvalidPackageName)
expect { described_class.new(".leading-dot") }.to raise_error(described_class::InvalidPackageName)
expect { described_class.new("_leading-underscore") }.to raise_error(described_class::InvalidPackageName)

expect do
described_class.new(" leading-space:and:weirdchars")
Expand Down

0 comments on commit b2b3cfe

Please sign in to comment.