@ztimson/utils 0.27.12 → 0.27.13

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.mjs CHANGED
@@ -2086,10 +2086,7 @@ class PathEvent {
2086
2086
  static filter(target, ...filter) {
2087
2087
  const parsedTarget = makeArray(target).map((pe) => pe instanceof PathEvent ? pe : new PathEvent(pe));
2088
2088
  const parsedFilter = makeArray(filter).map((pe) => pe instanceof PathEvent ? pe : new PathEvent(pe));
2089
- return parsedTarget.filter((t) => {
2090
- const combined = PathEvent.combine(t);
2091
- return !!parsedFilter.find((r) => PathEvent.matches(r, combined));
2092
- });
2089
+ return parsedTarget.filter((t) => !!parsedFilter.find((r) => PathEvent.matches(r, t)));
2093
2090
  }
2094
2091
  /**
2095
2092
  * Check if a filter pattern matches a target path
@@ -2118,8 +2115,7 @@ class PathEvent {
2118
2115
  static has(target, ...has) {
2119
2116
  const parsedTarget = makeArray(target).map((pe) => pe instanceof PathEvent ? pe : new PathEvent(pe));
2120
2117
  const parsedRequired = makeArray(has).map((pe) => pe instanceof PathEvent ? pe : new PathEvent(pe));
2121
- const effectiveTarget = parsedTarget.length === 1 ? parsedTarget[0] : PathEvent.combine(...parsedTarget);
2122
- return !!parsedRequired.find((r) => PathEvent.matches(r, effectiveTarget));
2118
+ return !!parsedRequired.find((r) => !!parsedTarget.find((t) => PathEvent.matches(r, t)));
2123
2119
  }
2124
2120
  /**
2125
2121
  * Squash 2 sets of paths & return true if the target has all paths