Skip to content

Commit

Permalink
fix: backport FindOperator return types (typeorm#6717)
Browse files Browse the repository at this point in the history
the `next` branch added return types to `FindOperator`s and
this backports that change
  • Loading branch information
imnotjames authored and Svetlozar committed Jan 12, 2021
1 parent dc0127c commit 4eb2107
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/find-options/operator/Any.ts
Expand Up @@ -4,6 +4,6 @@ import {FindOperator} from "../FindOperator";
* Find Options Operator.
* Example: { someField: Any([...]) }
*/
export function Any<T>(value: T[]|FindOperator<T>) {
export function Any<T>(value: T[]|FindOperator<T>): FindOperator<T> {
return new FindOperator("any", value as any);
}
}
4 changes: 2 additions & 2 deletions src/find-options/operator/Between.ts
Expand Up @@ -4,6 +4,6 @@ import {FindOperator} from "../FindOperator";
* Find Options Operator.
* Example: { someField: Between(x, y) }
*/
export function Between<T>(from: T|FindOperator<T>, to: T|FindOperator<T>) {
export function Between<T>(from: T|FindOperator<T>, to: T|FindOperator<T>): FindOperator<T> {
return new FindOperator("between", [from, to] as any, true, true);
}
}
4 changes: 2 additions & 2 deletions src/find-options/operator/In.ts
Expand Up @@ -4,6 +4,6 @@ import {FindOperator} from "../FindOperator";
* Find Options Operator.
* Example: { someField: In([...]) }
*/
export function In<T>(value: T[]|FindOperator<T>) {
export function In<T>(value: T[]|FindOperator<T>): FindOperator<T> {
return new FindOperator("in", value as any, true, true);
}
}
4 changes: 2 additions & 2 deletions src/find-options/operator/Raw.ts
Expand Up @@ -4,6 +4,6 @@ import {FindOperator} from "../FindOperator";
* Find Options Operator.
* Example: { someField: Raw([...]) }
*/
export function Raw<T>(value: string|((columnAlias: string) => string)) {
export function Raw<T>(value: string|((columnAlias: string) => string)): FindOperator<any> {
return new FindOperator("raw", value as any, false);
}
}

0 comments on commit 4eb2107

Please sign in to comment.