Skip to content

Commit

Permalink
feat(core): abstract OnlySubType type-level function
Browse files Browse the repository at this point in the history
  • Loading branch information
NWYLZW committed Feb 27, 2024
1 parent f3ab2f2 commit ad53ea4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/core/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ export type IsAnySubType<T, U> = IsTrue<
U extends infer UI ? IsSubType<T, UI> : never
>

export type OnlySubType<T, U> = Not<IsWhat<T, U>> extends true
? T extends U ? true : false
: false

export type Includes<
T extends readonly any[],
U extends readonly any[]
Expand Down

0 comments on commit ad53ea4

Please sign in to comment.