From c7630f8fe4ed0b664b34db18c1ef17b98f0f23a2 Mon Sep 17 00:00:00 2001 From: Tobias Speicher Date: Mon, 21 Mar 2022 06:16:14 +0100 Subject: [PATCH] Replace deprecated String.prototype.substr() .substr() is deprecated so we replace it with .slice() which works similarily but isn't deprecated Signed-off-by: Tobias Speicher --- index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index be6e5b1..16c6767 100644 --- a/index.js +++ b/index.js @@ -214,9 +214,9 @@ function mimeMatch (expected, actual) { } // validate suffix wildcard - if (expectedParts[1].substr(0, 2) === '*+') { + if (expectedParts[1].slice(0, 2) === '*+') { return expectedParts[1].length <= actualParts[1].length + 1 && - expectedParts[1].substr(1) === actualParts[1].substr(1 - expectedParts[1].length) + expectedParts[1].slice(1) === actualParts[1].slice(1 - expectedParts[1].length) } // validate subtype