From 1391c5cd4d88adf4a33d31bc8b3d4c8537441d01 Mon Sep 17 00:00:00 2001 From: Tobias Speicher Date: Sun, 20 Mar 2022 06:17:47 +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/help.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/help.js b/lib/help.js index eb4d2064b..17a2bf83c 100644 --- a/lib/help.js +++ b/lib/help.js @@ -387,8 +387,8 @@ class Help { const columnWidth = width - indent; if (columnWidth < minColumnWidth) return str; - const leadingStr = str.substr(0, indent); - const columnText = str.substr(indent); + const leadingStr = str.slice(0, indent); + const columnText = str.slice(indent); const indentString = ' '.repeat(indent); const regex = new RegExp('.{1,' + (columnWidth - 1) + '}([\\s\u200B]|$)|[^\\s\u200B]+?([\\s\u200B]|$)', 'g');