querysub 0.99.0 → 0.100.0
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/package.json +1 -1
- package/src/misc/filterable.ts +3 -2
package/package.json
CHANGED
package/src/misc/filterable.ts
CHANGED
|
@@ -87,6 +87,7 @@ export function mergeFilterables(filterables: Filterable[]): Filterable {
|
|
|
87
87
|
if (filterables.length === 0) return undefined;
|
|
88
88
|
if (filterables.length === 1) return filterables[0];
|
|
89
89
|
let values = Array.from(new Set(filterables.flatMap(filterable => filterable?.values ?? [])));
|
|
90
|
+
if (values.length === 0) return undefined;
|
|
90
91
|
return {
|
|
91
92
|
values,
|
|
92
93
|
};
|
|
@@ -370,9 +371,9 @@ async function main() {
|
|
|
370
371
|
[["a"], ["b"], ["c"], ["d"]]);
|
|
371
372
|
|
|
372
373
|
// Test empty and undefined cases
|
|
373
|
-
assert(() =>
|
|
374
|
+
assert(() => doesMatch(undefined, undefined), "undefined should match undefined");
|
|
374
375
|
assert(() => !doesMatch(undefined, parseFilterSelector("a")), "undefined should not match filter");
|
|
375
|
-
assert(() => doesMatch({ values: ["a"] }, undefined), "non-empty values should match undefined");
|
|
376
|
+
assert(() => !doesMatch({ values: ["a"] }, undefined), "non-empty values should not match undefined");
|
|
376
377
|
|
|
377
378
|
// Test mergeSelectors
|
|
378
379
|
const merged = mergeSelectors([
|