Skip to content

Commit

Permalink
fix: replace deprecated String.prototype.substr() (#38)
Browse files Browse the repository at this point in the history
.substr() is deprecated so we replace it with .slice() which works similarily but isn't deprecated

Signed-off-by: Tobias Speicher <[email protected]>
  • Loading branch information
CommanderRoot authored and lukekarrys committed Oct 31, 2022
1 parent 602c0fe commit b658525
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ function abbrev (...args) {
abbrevs[current] = current
continue
}
for (let a = current.substr(0, j); j <= cl; j++) {
for (let a = current.slice(0, j); j <= cl; j++) {
abbrevs[a] = current
a += current.charAt(j)
}
Expand Down

0 comments on commit b658525

Please sign in to comment.