From 4a7dc6ce3b63d2a64c59345fda6e799c8973c410 Mon Sep 17 00:00:00 2001 From: Tobias Speicher Date: Tue, 22 Mar 2022 09:42:18 +0100 Subject: [PATCH] refactor: 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 --- lib/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/index.js b/lib/index.js index 8a0811c4..4faee7a6 100755 --- a/lib/index.js +++ b/lib/index.js @@ -59,8 +59,8 @@ function toIdentifierCase( text ) { return word.toLowerCase(); } return ( - word.substr( 0, 1 ).toUpperCase() - + word.substr( 1 ).toLowerCase() + word.slice( 0, 1 ).toUpperCase() + + word.slice( 1 ).toLowerCase() ); } ) .join( '' );