Skip to content

Commit

Permalink
fix: replace deprecated String.prototype.substr() (#41)
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 <rootcommander@gmail.com>
  • Loading branch information
CommanderRoot authored Jun 16, 2022
1 parent cc436a8 commit 1452a05
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 @@ -12,7 +12,7 @@ function appendNegatedPatterns (patterns) {
for (let pattern of patterns) {
const excl = pattern.match(/^!+/)
if (excl) {
pattern = pattern.substr(excl[0].length)
pattern = pattern.slice(excl[0].length)
}

// strip off any / from the start of the pattern. /foo => foo
Expand Down

0 comments on commit 1452a05

Please sign in to comment.