From 9825e98613a1b098f810268b7b7b4e4dbf397d82 Mon Sep 17 00:00:00 2001 From: Tobias Speicher Date: Sat, 26 Mar 2022 01:02:43 +0100 Subject: [PATCH] chore: 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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 6f2fcd5..c897c56 100644 --- a/index.js +++ b/index.js @@ -93,7 +93,7 @@ var validateUrl = function (urlToValidate, hostPattern) { var parsed = url.parse(urlToValidate); return parsed.protocol === 'https:' - && parsed.path.substr(-4) === '.pem' + && parsed.path.slice(-4) === '.pem' && hostPattern.test(parsed.host); };