mirror of
https://github.com/verdaccio/verdaccio.git
synced 2025-01-20 22:52:46 -05:00
Merge pull request #1417 from jamesgeorge007/feat/minor-refactor
chore: minor refactor to eliminate code redundancy
This commit is contained in:
commit
6aa3bdc514
1 changed files with 2 additions and 4 deletions
|
@ -70,10 +70,8 @@ export function validateName(name: string): boolean {
|
|||
*/
|
||||
return !(
|
||||
!normalizedName.match(/^[-a-zA-Z0-9_.!~*'()@]+$/) ||
|
||||
normalizedName.charAt(0) === '.' || // ".bin", etc.
|
||||
normalizedName === 'node_modules' ||
|
||||
normalizedName === '__proto__' ||
|
||||
normalizedName === 'favicon.ico'
|
||||
normalizedName.startsWith('.') || // ".bin", etc.
|
||||
['node_modules', '__proto__', 'favicon.ico'].indexOf(normalizedName) !== -1
|
||||
);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue