Skip to content

Commit

Permalink
fix: Mark array arguments to find operators as read-only (#9474)
Browse files Browse the repository at this point in the history
Co-authored-by: AlexMesser <dmzt08@gmail.com>
  • Loading branch information
foxymiles and AlexMesser committed Nov 5, 2022
1 parent 19536ed commit 6eb674b
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 5 deletions.
1 change: 1 addition & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/find-options/operator/Any.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ import { FindOperator } from "../FindOperator"
* Find Options Operator.
* Example: { someField: Any([...]) }
*/
export function Any<T>(value: T[] | FindOperator<T>): FindOperator<T> {
export function Any<T>(value: readonly T[] | FindOperator<T>): FindOperator<T> {
return new FindOperator("any", value as any)
}
2 changes: 1 addition & 1 deletion src/find-options/operator/ArrayContainedBy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { FindOperator } from "../FindOperator"
* Example: { someField: ArrayContainedBy([...]) }
*/
export function ArrayContainedBy<T>(
value: T[] | FindOperator<T>,
value: readonly T[] | FindOperator<T>,
): FindOperator<any> {
return new FindOperator("arrayContainedBy", value as any)
}
2 changes: 1 addition & 1 deletion src/find-options/operator/ArrayContains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { FindOperator } from "../FindOperator"
* Example: { someField: ArrayContains([...]) }
*/
export function ArrayContains<T>(
value: T[] | FindOperator<T>,
value: readonly T[] | FindOperator<T>,
): FindOperator<any> {
return new FindOperator("arrayContains", value as any)
}
2 changes: 1 addition & 1 deletion src/find-options/operator/ArrayOverlap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { FindOperator } from "../FindOperator"
* Example: { someField: ArrayOverlap([...]) }
*/
export function ArrayOverlap<T>(
value: T[] | FindOperator<T>,
value: readonly T[] | FindOperator<T>,
): FindOperator<any> {
return new FindOperator("arrayOverlap", value as any)
}
4 changes: 3 additions & 1 deletion src/find-options/operator/In.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import { FindOperator } from "../FindOperator"
* Find Options Operator.
* Example: { someField: In([...]) }
*/
export function In<T>(value: T[] | FindOperator<T>): FindOperator<any> {
export function In<T>(
value: readonly T[] | FindOperator<T>,
): FindOperator<any> {
return new FindOperator("in", value as any, true, true)
}

0 comments on commit 6eb674b

Please sign in to comment.