Skip to content

Commit

Permalink
Merge pull request #90 from Boilingwaterr/type-issue
Browse files Browse the repository at this point in the history
fixed type loading by added NestedOrderBy type
  • Loading branch information
techniq authored Aug 20, 2021
2 parents f3c6cef + 14c22ee commit 385c2d7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ const INDEXOF_REGEX = /(?!indexof)\((\w+)\)/;

export type PlainObject = { [property: string]: any };
export type Select<T> = string | keyof T | Array<keyof T>;
export type OrderBy<T> = string | OrderByOptions<T> | Array<OrderByOptions<T>> | { [P in keyof T]?: OrderBy<T[P]> };
export type NestedOrderBy<T> = { [P in keyof T]?: T[P] extends Array<infer E> ? OrderBy<E> : OrderBy<T[P]> }
export type OrderBy<T> = string | OrderByOptions<T> | Array<OrderByOptions<T>> | NestedOrderBy<T>;
export type Filter = string | PlainObject | Array<string | PlainObject>;
export type NestedExpandOptions<T> = {[P in keyof T]?: (T[P] extends Array<infer E> ? Partial<ExpandOptions<E>> : Partial<ExpandOptions<T[P]>>) };
export type Expand<T> = string | keyof T | NestedExpandOptions<T> | Array<keyof T | NestedExpandOptions<T>> | Array<string | NestedExpandOptions<T>>;
Expand Down

0 comments on commit 385c2d7

Please sign in to comment.