Skip to content

Commit

Permalink
lint: remove deprecated String.prototype.substr
Browse files Browse the repository at this point in the history
closes #96
  • Loading branch information
CommanderRoot authored and dougwilson committed Feb 6, 2023
1 parent ce58258 commit c77d6b0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ function lookup (path) {
// get the extension ("ext" or ".ext" or full path)
var extension = extname('x.' + path)
.toLowerCase()
.substr(1)
.slice(1)

if (!extension) {
return false
Expand Down Expand Up @@ -175,7 +175,7 @@ function populateMaps (extensions, types) {
var to = preference.indexOf(mime.source)

if (types[extension] !== 'application/octet-stream' &&
(from > to || (from === to && types[extension].substr(0, 12) === 'application/'))) {
(from > to || (from === to && types[extension].slice(0, 12) === 'application/'))) {
// skip the remapping
continue
}
Expand Down

0 comments on commit c77d6b0

Please sign in to comment.