Skip to content

Commit 3ff93ec

Browse files
committed
Improve arr_contains validators
1 parent 7d3f1f4 commit 3ff93ec

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "strontium",
3-
"version": "2.9.5",
3+
"version": "2.9.6",
44
"description": "Strontium is a TypeScript toolkit for High Performance API servers built for Production not Projects.",
55
"main": "lib/src/index.js",
66
"types": "lib/src/index.d.ts",

src/query/abstract/Filter.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export type FieldFilter<P extends keyof T, T> =
1212
$lt?: T[P]
1313
$lte?: T[P]
1414
$contains?: T[P]
15-
$arr_contains?: Array<T[P]>
15+
$arr_contains?: T[P] // Could be made conditional so it only appears where T[P] is an Array
1616
}
1717
| T[P]
1818

src/validation/drivers/validators/isFilter.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,6 @@ const isFieldSelector = (keyValidator: ValidatorFunction<any, any>) =>
4646
$lt: either(isUndefined, keyValidator),
4747
$lte: either(isUndefined, keyValidator),
4848
$contains: either(isUndefined, keyValidator),
49-
$arr_contains: either(isUndefined, isArray(keyValidator)),
49+
$arr_contains: either(isUndefined, keyValidator),
5050
})
5151
)

0 commit comments

Comments
 (0)