Skip to content

Commit

Permalink
fix: replace deprecated String.prototype.substr() (#115)
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 Apr 13, 2022
1 parent 9a04ff2 commit 804411f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/errors.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const url = require('url')

function packageName (href) {
try {
let basePath = new url.URL(href).pathname.substr(1)
let basePath = new url.URL(href).pathname.slice(1)
if (!basePath.match(/^-/)) {
basePath = basePath.split('/')
var index = basePath.indexOf('_rewrite')
Expand Down

0 comments on commit 804411f

Please # to comment.