@ztimson/utils 0.28.4 → 0.28.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +4 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +4 -0
- package/dist/index.mjs.map +1 -1
- package/dist/path-events.d.ts +2 -0
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1884,6 +1884,8 @@ class PathEvent {
|
|
|
1884
1884
|
module;
|
|
1885
1885
|
/** Entire path, including the module & name */
|
|
1886
1886
|
fullPath;
|
|
1887
|
+
/** Parent directory, excludes module & name */
|
|
1888
|
+
dir;
|
|
1887
1889
|
/** Path including the name, excluding the module */
|
|
1888
1890
|
path;
|
|
1889
1891
|
/** Last segment of path */
|
|
@@ -1961,6 +1963,7 @@ class PathEvent {
|
|
|
1961
1963
|
if (p === "" || p === void 0 || p === "*") {
|
|
1962
1964
|
this.module = "";
|
|
1963
1965
|
this.path = "";
|
|
1966
|
+
this.dir = "";
|
|
1964
1967
|
this.fullPath = "**";
|
|
1965
1968
|
this.name = "";
|
|
1966
1969
|
this.methods = new ASet(p === "*" ? ["*"] : method.split(""));
|
|
@@ -1971,6 +1974,7 @@ class PathEvent {
|
|
|
1971
1974
|
let temp = p.split("/").filter((p2) => !!p2);
|
|
1972
1975
|
this.module = temp.splice(0, 1)[0] || "";
|
|
1973
1976
|
this.path = temp.join("/");
|
|
1977
|
+
this.dir = temp.length > 2 ? temp.slice(0, -1).join("/") : "";
|
|
1974
1978
|
this.fullPath = `${this.module}${this.module && this.path ? "/" : ""}${this.path}`;
|
|
1975
1979
|
this.name = temp.pop() || "";
|
|
1976
1980
|
this.hasGlob = this.fullPath.includes("*");
|