@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.cjs CHANGED
@@ -2090,10 +2090,7 @@ ${opts.message || this.desc}`;
2090
2090
  static filter(target, ...filter) {
2091
2091
  const parsedTarget = makeArray(target).map((pe) => pe instanceof PathEvent ? pe : new PathEvent(pe));
2092
2092
  const parsedFilter = makeArray(filter).map((pe) => pe instanceof PathEvent ? pe : new PathEvent(pe));
2093
- return parsedTarget.filter((t) => {
2094
- const combined = PathEvent.combine(t);
2095
- return !!parsedFilter.find((r) => PathEvent.matches(r, combined));
2096
- });
2093
+ return parsedTarget.filter((t) => !!parsedFilter.find((r) => PathEvent.matches(r, t)));
2097
2094
  }
2098
2095
  /**
2099
2096
  * Check if a filter pattern matches a target path
@@ -2122,8 +2119,7 @@ ${opts.message || this.desc}`;
2122
2119
  static has(target, ...has) {
2123
2120
  const parsedTarget = makeArray(target).map((pe) => pe instanceof PathEvent ? pe : new PathEvent(pe));
2124
2121
  const parsedRequired = makeArray(has).map((pe) => pe instanceof PathEvent ? pe : new PathEvent(pe));
2125
- const effectiveTarget = parsedTarget.length === 1 ? parsedTarget[0] : PathEvent.combine(...parsedTarget);
2126
- return !!parsedRequired.find((r) => PathEvent.matches(r, effectiveTarget));
2122
+ return !!parsedRequired.find((r) => !!parsedTarget.find((t) => PathEvent.matches(r, t)));
2127
2123
  }
2128
2124
  /**
2129
2125
  * Squash 2 sets of paths & return true if the target has all paths