0
Fork 0
mirror of https://github.com/verdaccio/verdaccio.git synced 2024-12-16 21:56:25 -05:00

refactor: use Array.includes (#1596)

This commit is contained in:
James George 2019-12-07 12:14:11 +05:30 committed by Juan Picado @jotadeveloper
parent 19281f86f9
commit 05c9d0507c

View file

@ -82,7 +82,7 @@ export function validateName(name: string): boolean {
return !(
!normalizedName.match(/^[-a-zA-Z0-9_.!~*'()@]+$/) ||
normalizedName.startsWith('.') || // ".bin", etc.
['node_modules', '__proto__', 'favicon.ico'].indexOf(normalizedName) !== -1
['node_modules', '__proto__', 'favicon.ico'].includes(normalizedName)
);
}