Skip to content

Commit

Permalink
url: replace deprecated substr() -> substring()
Browse files Browse the repository at this point in the history
  • Loading branch information
pluris authored and jpluris-lee committed Jan 23, 2024
1 parent 880c90c commit 6e2fe0e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/url.js
Original file line number Diff line number Diff line change
Expand Up @@ -958,7 +958,8 @@ Url.prototype.resolveObject = function resolveObject(relative) {
srcPath.unshift('');
}

if (hasTrailingSlash && (srcPath.join('/').substr(-1) !== '/')) {
const srcPathSlashes = srcPath.join('/');
if (hasTrailingSlash && (srcPathSlashes.substring(srcPathSlashes.length - 1) !== '/')) {
srcPath.push('');
}

Expand Down

0 comments on commit 6e2fe0e

Please sign in to comment.