utils.d.ts
This file
Path
types/utils.d.ts
9 lines · 539 bytes · TypeScript
Last changed by
Split type files (#978)ehmickybefore adoption0bd0f0d
History of this fileTake it
12345678910export type Not<Value extends boolean> = Value extends true ? false : true;
export type And<First extends boolean, Second extends boolean> = First extends true ? Second : false;
export type Or<First extends boolean, Second extends boolean> = First extends true ? true : Second;
export type Unless<Condition extends boolean, ThenValue, ElseValue = never> = Condition extends true ? ElseValue : ThenValue;
export type AndUnless<Condition extends boolean, ThenValue, ElseValue = unknown> = Condition extends true ? ElseValue : ThenValue;