Skip to content

Commit ea0a91f

Browse files
authored
Fix $nin query similar to $in fix from PR #36 (#55)
1 parent aa4e94a commit ea0a91f

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/ItemSelector.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,13 @@ export class ItemSelector {
149149
}
150150
break;
151151
case '$nin':
152-
if (typeof value == 'boolean' || filter[key]!.includes(value)) {
152+
if (typeof value == 'boolean') {
153+
return false;
154+
}
155+
else if (typeof value == 'string' && filter[key]!.includes(value)) {
156+
return false;
157+
}
158+
else if (filter[key]!.some(val => typeof val == 'string' && val.includes(value))) {
153159
return false;
154160
}
155161
break;

0 commit comments

Comments
 (0)