From 72b4956049769b99305b8934ec5448ab4184181f Mon Sep 17 00:00:00 2001 From: Luke Karrys Date: Sun, 11 Dec 2022 18:39:03 -0700 Subject: [PATCH] fix: replace substr with slice --- lib/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/index.js b/lib/index.js index 599a617..368f727 100644 --- a/lib/index.js +++ b/lib/index.js @@ -93,7 +93,7 @@ class MuteStream extends Stream { // eslint-disable-next-line no-control-regex if (c.match(/^\u001b/)) { if (c.indexOf(this._prompt) === 0) { - c = c.substr(this._prompt.length) + c = c.slice(this._prompt.length) c = c.replace(/./g, this.replace) c = this._prompt + c } @@ -104,7 +104,7 @@ class MuteStream extends Stream { c.indexOf(this._prompt) === 0) { this._hadControl = false this.emit('data', this._prompt) - c = c.substr(this._prompt.length) + c = c.slice(this._prompt.length) } c = c.toString().replace(/./g, this.replace) }