Skip to content

Commit

Permalink
Revert "fix: for null type"
Browse files Browse the repository at this point in the history
This reverts commit 0e0feb5.
  • Loading branch information
Yuuki-Sakura authored and Ruben committed Nov 18, 2024
1 parent 7d497f5 commit a2c40a5
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/find-options/FindReturnType.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ type TruthyKeys<T> = {
[K in keyof T]: true extends T[K] ? K : T[K] extends object ? K : never
}[keyof T]

type ExtractUndefined<T> = Exclude<T, Exclude<T, undefined>>
type ExtractNil<T> = Exclude<T, Exclude<T, undefined | null>>

type ArrayType<I, E> = Array<I> | ExtractUndefined<E>
type ArrayType<I, E> = Array<I> | ExtractNil<E>

export type FindReturnType<
Entity extends ObjectLiteral,
Expand Down Expand Up @@ -58,10 +58,6 @@ export type FindReturnType<
? FindReturnType<Entity[R], Select[R], undefined>
: Entity[R]
: Entity[R]
} & {
[R in Select extends FindOptionsSelectByString<Entity>
? Select[number]
: never]: Entity[R]
} & {
[R in Relation extends FindOptionsRelationByString
? never
Expand All @@ -82,4 +78,8 @@ export type FindReturnType<
? FindReturnType<Entity[R], undefined, Relation[R]>
: Entity[R]
: Entity[R]
} & {
[R in Select extends FindOptionsSelectByString<Entity>
? Select[number]
: never]: Entity[R]
}

0 comments on commit a2c40a5

Please sign in to comment.