We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
String.prototype.substr()
1 parent 1975c5c commit dfee8deCopy full SHA for dfee8de
lib/contrib/parseuri.ts
@@ -45,10 +45,10 @@ function pathNames(obj, path) {
45
const regx = /\/{2,9}/g,
46
names = path.replace(regx, "/").split("/");
47
48
- if (path.substr(0, 1) == '/' || path.length === 0) {
+ if (path.slice(0, 1) == '/' || path.length === 0) {
49
names.splice(0, 1);
50
}
51
- if (path.substr(path.length - 1, 1) == '/') {
+ if (path.slice(-1) == '/') {
52
names.splice(names.length - 1, 1);
53
54
0 commit comments