Skip to content

Commit

Permalink
fix: replace substr with slice
Browse files Browse the repository at this point in the history
  • Loading branch information
lukekarrys committed Dec 12, 2022
1 parent bb1e248 commit 72b4956
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand All @@ -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)
}
Expand Down

0 comments on commit 72b4956

Please sign in to comment.