Skip to content

Commit

Permalink
refactor: replace deprecated String.prototype.substr()
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 committed Mar 27, 2022
1 parent 0ec6e80 commit a084959
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion bin/args.js
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ function splitOnColon (f) {
if ((/[a-zA-Z]:[\\/]/.test(f)) && (pos == 1)){
return [f]; // Windows path and colon is part of drive name
} else {
return [f.substr(0, pos), f.substr(pos + 1)];
return [f.slice(0, pos), f.slice(pos + 1)];
}
}
}

0 comments on commit a084959

Please sign in to comment.