mirror of
https://github.com/verdaccio/verdaccio.git
synced 2025-02-21 07:29:37 +01:00
refactor: use Array.includes (#1596)
This commit is contained in:
parent
19281f86f9
commit
05c9d0507c
@ -82,7 +82,7 @@ export function validateName(name: string): boolean {
|
|||||||
return !(
|
return !(
|
||||||
!normalizedName.match(/^[-a-zA-Z0-9_.!~*'()@]+$/) ||
|
!normalizedName.match(/^[-a-zA-Z0-9_.!~*'()@]+$/) ||
|
||||||
normalizedName.startsWith('.') || // ".bin", etc.
|
normalizedName.startsWith('.') || // ".bin", etc.
|
||||||
['node_modules', '__proto__', 'favicon.ico'].indexOf(normalizedName) !== -1
|
['node_modules', '__proto__', 'favicon.ico'].includes(normalizedName)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user