@ztimson/utils 0.27.13 → 0.27.14
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 -13
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +4 -13
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1960,22 +1960,12 @@ ${opts.message || this.desc}`;
|
|
|
1960
1960
|
}
|
|
1961
1961
|
let [p, method] = e.replaceAll(/\/{2,}/g, "/").split(":");
|
|
1962
1962
|
if (!method) method = "*";
|
|
1963
|
-
if (p === "" || p === void 0) {
|
|
1964
|
-
this.module = "";
|
|
1965
|
-
this.path = "";
|
|
1966
|
-
this.fullPath = "";
|
|
1967
|
-
this.name = "";
|
|
1968
|
-
this.methods = new ASet(["n"]);
|
|
1969
|
-
this.hasGlob = false;
|
|
1970
|
-
PathEvent.pathEventCache.set(e, this);
|
|
1971
|
-
return;
|
|
1972
|
-
}
|
|
1973
|
-
if (p === "*") {
|
|
1963
|
+
if (p === "" || p === void 0 || p === "*") {
|
|
1974
1964
|
this.module = "";
|
|
1975
1965
|
this.path = "";
|
|
1976
1966
|
this.fullPath = "**";
|
|
1977
1967
|
this.name = "";
|
|
1978
|
-
this.methods = new ASet(["*"]);
|
|
1968
|
+
this.methods = new ASet(p === "*" ? ["*"] : method.split(""));
|
|
1979
1969
|
this.hasGlob = true;
|
|
1980
1970
|
PathEvent.pathEventCache.set(e, this);
|
|
1981
1971
|
return;
|
|
@@ -2098,7 +2088,8 @@ ${opts.message || this.desc}`;
|
|
|
2098
2088
|
*/
|
|
2099
2089
|
static matches(pattern, target) {
|
|
2100
2090
|
if (pattern.fullPath === "" || target.fullPath === "") return false;
|
|
2101
|
-
if (pattern.fullPath === "
|
|
2091
|
+
if (pattern.fullPath === "**") return pattern.methods.has("*") || pattern.methods.intersection(target.methods).length > 0;
|
|
2092
|
+
if (target.fullPath === "**") return pattern.methods.has("*") || target.methods.has("*") || pattern.methods.intersection(target.methods).length > 0;
|
|
2102
2093
|
const methodsMatch = pattern.all || target.all || pattern.methods.intersection(target.methods).length > 0;
|
|
2103
2094
|
if (!methodsMatch) return false;
|
|
2104
2095
|
if (!pattern.hasGlob && !target.hasGlob) {
|