From cc4c5681f7e2b554049e5aa299e57195af9e73c5 Mon Sep 17 00:00:00 2001 From: Tobias Speicher Date: Mon, 21 Mar 2022 06:26:10 +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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index c425f1e..57773ce 100644 --- a/index.js +++ b/index.js @@ -283,7 +283,7 @@ function populateConstructorExports (exports, codes, HttpError) { */ function toClassName (name) { - return name.substr(-5) !== 'Error' + return name.slice(-5) !== 'Error' ? name + 'Error' : name }