Skip to content

Commit 385c2d7

Browse files
authored
Merge pull request #90 from Boilingwaterr/type-issue
fixed type loading by added NestedOrderBy type
2 parents f3c6cef + 14c22ee commit 385c2d7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ const INDEXOF_REGEX = /(?!indexof)\((\w+)\)/;
1717

1818
export type PlainObject = { [property: string]: any };
1919
export type Select<T> = string | keyof T | Array<keyof T>;
20-
export type OrderBy<T> = string | OrderByOptions<T> | Array<OrderByOptions<T>> | { [P in keyof T]?: OrderBy<T[P]> };
20+
export type NestedOrderBy<T> = { [P in keyof T]?: T[P] extends Array<infer E> ? OrderBy<E> : OrderBy<T[P]> }
21+
export type OrderBy<T> = string | OrderByOptions<T> | Array<OrderByOptions<T>> | NestedOrderBy<T>;
2122
export type Filter = string | PlainObject | Array<string | PlainObject>;
2223
export type NestedExpandOptions<T> = {[P in keyof T]?: (T[P] extends Array<infer E> ? Partial<ExpandOptions<E>> : Partial<ExpandOptions<T[P]>>) };
2324
export type Expand<T> = string | keyof T | NestedExpandOptions<T> | Array<keyof T | NestedExpandOptions<T>> | Array<string | NestedExpandOptions<T>>;

0 commit comments

Comments
 (0)