From 6b8e0f25d6576e29fe5bdb995bef32dace77d557 Mon Sep 17 00:00:00 2001 From: CommanderRoot Date: Mon, 18 Apr 2022 03:42:45 +0200 Subject: [PATCH] Replace deprecated String.prototype.substr() (#2427) String.prototype.substr() is deprecated (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/substr) so we replace it with slice() which works similarily but isn't deprecated. Signed-off-by: Tobias Speicher --- src/js/utils/strings.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/js/utils/strings.js b/src/js/utils/strings.js index d4cc1efa..3e78a8e6 100644 --- a/src/js/utils/strings.js +++ b/src/js/utils/strings.js @@ -33,7 +33,7 @@ export const replaceAll = (input = '', find = '', replace = '') => // Convert to title case export const toTitleCase = (input = '') => - input.toString().replace(/\w\S*/g, (text) => text.charAt(0).toUpperCase() + text.substr(1).toLowerCase()); + input.toString().replace(/\w\S*/g, (text) => text.charAt(0).toUpperCase() + text.slice(1).toLowerCase()); // Convert string to pascalCase export function toPascalCase(input = '') {