Skip to content

Commit ae9cdea

Browse files
committed
/taxa filters allows empty array (as no-op)
1 parent 9b56fe8 commit ae9cdea

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/taxa/taxa-elastic-query.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ const applyFiltersToElasticQuery = (filters: TaxaFilters = {}, filtersSchema: JS
181181
if (typeof arg === "string") {
182182
arg = [arg];
183183
}
184-
if (Array.isArray(arg) && typeof arg[0] === "string") {
184+
if (Array.isArray(arg) && arg.every(a => typeof a === "string")) {
185185
const inclusions: string[] = [];
186186
const exclusions: string[] = [];
187187
arg.forEach(subArg => (subArg[0] === "!" ? exclusions : inclusions).push(subArg.replace(/^!/, "")));

0 commit comments

Comments
 (0)