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 <rootcommander@gmail.com>
This commit is contained in:
Tobias Speicher 2022-03-22 09:42:18 +01:00
parent 9116b2d2a7
commit 4a7dc6ce3b
No known key found for this signature in database
GPG key ID: 2CF824BD810C3BDB

View file

@ -59,8 +59,8 @@ function toIdentifierCase( text ) {
return word.toLowerCase(); return word.toLowerCase();
} }
return ( return (
word.substr( 0, 1 ).toUpperCase() word.slice( 0, 1 ).toUpperCase()
+ word.substr( 1 ).toLowerCase() + word.slice( 1 ).toLowerCase()
); );
} ) } )
.join( '' ); .join( '' );