Skip to content

Commit 804411f

Browse files
fix: replace deprecated String.prototype.substr() (#115)
.substr() is deprecated so we replace it with .slice() which works similarily but isn't deprecated Signed-off-by: Tobias Speicher <[email protected]>
1 parent 9a04ff2 commit 804411f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/errors.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const url = require('url')
44

55
function packageName (href) {
66
try {
7-
let basePath = new url.URL(href).pathname.substr(1)
7+
let basePath = new url.URL(href).pathname.slice(1)
88
if (!basePath.match(/^-/)) {
99
basePath = basePath.split('/')
1010
var index = basePath.indexOf('_rewrite')

0 commit comments

Comments
 (0)