From 9b334123f1331a252bc27c99c33b5c4f199d200f Mon Sep 17 00:00:00 2001 From: CommanderRoot Date: Thu, 17 Mar 2022 14:36:24 +0100 Subject: [PATCH] replace deprecated String.prototype.substr() (#876) 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/common.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common.js b/src/common.js index 6d571d28..e3291b20 100644 --- a/src/common.js +++ b/src/common.js @@ -179,7 +179,7 @@ function setup(env) { namespaces = split[i].replace(/\*/g, '.*?'); if (namespaces[0] === '-') { - createDebug.skips.push(new RegExp('^' + namespaces.substr(1) + '$')); + createDebug.skips.push(new RegExp('^' + namespaces.slice(1) + '$')); } else { createDebug.names.push(new RegExp('^' + namespaces + '$')); }