Skip to content

Commit

Permalink
refactor(Defined): remove the use of Never type cause of compile is…
Browse files Browse the repository at this point in the history
…sues.
  • Loading branch information
sciborrudnicki committed Sep 20, 2021
1 parent de6aa12 commit e09a84f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/type/defined.type.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Never } from './never.type';
/**
* A type from the provided generic `Type` variable, besides an `undefined` which causes its change to `never`.
* A generic type `Defined` that takes generic type variable `Type` constrained by `undefined` by using `Never` which constraint causes its
* change to `never`.
*/
export type Defined<Type> = Never<undefined, Type>;
export type Defined<Type> = Type extends undefined ? never : Type;

0 comments on commit e09a84f

Please sign in to comment.