Skip to content

Commit

Permalink
Updated the return type of the function findBy to generic type. (#39)
Browse files Browse the repository at this point in the history
  • Loading branch information
deepakjosp authored Mar 13, 2024
1 parent 9b5f349 commit 17d080c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions typeTemplates/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,12 +114,12 @@ export function _filterBy(
export function filterNonNull(object: object): object;
export function _filterNonNull(object: NilOr<object>): NilOr<object>;

export function findBy<T>(pattern: MatchPattern<T>, entityArray: T[]): T;
export function findBy<T, P>(pattern: MatchPattern<T>, entityArray: P[]): P;
export function findBy(pattern: MatchPattern): <T>(entityArray: T[]) => T;
export function _findBy<T>(
export function _findBy<T, P>(
pattern: MatchPattern<T>,
entityArray: NilOr<T[]>
): NilOr<T>;
entityArray: NilOr<P[]>
): NilOr<P>;
export function _findBy(
pattern: MatchPattern
): <T>(entityArray: NilOr<T[]>) => NilOr<T>;
Expand Down

0 comments on commit 17d080c

Please sign in to comment.