From e1b52f26ae86e81d1c41d01b2847e52fc88a5f42 Mon Sep 17 00:00:00 2001 From: Tobias Speicher Date: Tue, 22 Mar 2022 10:05:12 +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 --- src/helper/DiffEmitter.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/helper/DiffEmitter.ts b/src/helper/DiffEmitter.ts index a40d2e0..66b1038 100644 --- a/src/helper/DiffEmitter.ts +++ b/src/helper/DiffEmitter.ts @@ -26,7 +26,7 @@ function mergeDiff(olds: IDiffEvent[], change: IDiffEvent): IDiffEvent[] { return olds; // Merge and pop already existing information into a single object } else if (event.path.startsWith(path)) { - set(old, event.path.substr(path.length + 1), event.old); + set(old, event.path.slice(path.length + 1), event.old); olds.splice(i, i + 1); } else { i++;