type error fixed

trailingSlash is both a property and a method
property denoted by "hasTrailingSlash" now
This commit is contained in:
Nate De Luna
2023-12-27 11:23:42 -06:00
parent 105d78faed
commit 07793dcd19

View File

@@ -1,6 +1,6 @@
class PathProcessor {
path;
trailingSlash = false;
hasTrailingSlash = false;
node = (typeof module !== 'undefined' && module.exports) ? true : false;
constructor(path) {
@@ -59,7 +59,7 @@ class PathProcessor {
trailingSlash() {
this.path = this.path.endsWith("/") ? this.path : this.path+"/";
this.trailingSlash = true;
this.hasTrailingSlash = true;
return this;
}
@@ -92,7 +92,7 @@ class PathProcessor {
}
build() {
return this.trailingSlash ? this.path : this.#removeTrailingSlash(this.path)
return this.hasTrailingSlash ? this.path : this.#removeTrailingSlash(this.path)
}
}