Skip to content

Commit c77d6b0

Browse files
CommanderRootdougwilson
authored andcommitted
lint: remove deprecated String.prototype.substr
closes #96
1 parent ce58258 commit c77d6b0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

index.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ function lookup (path) {
137137
// get the extension ("ext" or ".ext" or full path)
138138
var extension = extname('x.' + path)
139139
.toLowerCase()
140-
.substr(1)
140+
.slice(1)
141141

142142
if (!extension) {
143143
return false
@@ -175,7 +175,7 @@ function populateMaps (extensions, types) {
175175
var to = preference.indexOf(mime.source)
176176

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

0 commit comments

Comments
 (0)