From 1a6394de09bab9346edc81612d8b6415ad3daecb Mon Sep 17 00:00:00 2001 From: Tobias Speicher Date: Fri, 18 Mar 2022 02:37:25 +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 --- src/components/Support/Support.jsx | 2 +- src/remark-plugins/remark-custom-asides/index.mjs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/Support/Support.jsx b/src/components/Support/Support.jsx index 4a0ce57b648a..0642933c6544 100644 --- a/src/components/Support/Support.jsx +++ b/src/components/Support/Support.jsx @@ -85,7 +85,7 @@ function formatMoney(number) { let str = Math.round(number) + ''; if (str.length > 3) { - str = str.substr(0, str.length - 3) + ',' + str.substr(-3); + str = str.slice(0, -3) + ',' + str.slice(-3); } return str; } diff --git a/src/remark-plugins/remark-custom-asides/index.mjs b/src/remark-plugins/remark-custom-asides/index.mjs index e63990b0c6e9..96e7c43c808b 100644 --- a/src/remark-plugins/remark-custom-asides/index.mjs +++ b/src/remark-plugins/remark-custom-asides/index.mjs @@ -20,7 +20,7 @@ export default function customAsides( if (!textNode) return; // looking for mapping in the beginning - const className = mapping[textNode.substr(0, 2)]; + const className = mapping[textNode.slice(0, 2)]; // >This is a joke <- ignore this // >T hi there const hasPostfixWhitespace = textNode.indexOf(' ') === 2;