refactor: replace deprecated String.prototype.substr() (#3600)

.substr() is deprecated so we replace it with .slice() which works similarily but isn't deprecated

Signed-off-by: Tobias Speicher <rootcommander@gmail.com>
This commit is contained in:
CommanderRoot 2022-03-28 07:29:50 +02:00 committed by GitHub
parent c9dcc93d4f
commit e960357dcf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -59,7 +59,7 @@ class Restricter {
// otherwise this is likely an extension
if (type[0] === '.' && file.extension) {
return file.extension.toLowerCase() === type.substr(1).toLowerCase()
return file.extension.toLowerCase() === type.slice(1).toLowerCase()
}
return false
})