From c77d6b02139075e4f63230a970411b3c92d066e2 Mon Sep 17 00:00:00 2001 From: Tobias Speicher Date: Mon, 21 Mar 2022 06:22:01 +0100 Subject: [PATCH] lint: remove deprecated String.prototype.substr closes #96 --- index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index b9f34d5..9d09a11 100644 --- a/index.js +++ b/index.js @@ -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 @@ -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 }