Works with
•JSR Score52%•It is unknown whether this package works with Browsers, Deno, Node.js, Cloudflare Workers, Bun




Published2 years ago (0.215.0)
Functions
f
assertType<T extends true | false>(_expectTrue: T): void
Asserts at compile time that the provided type argument's type resolves to the expected boolean literal type.
Type Aliases
T
Assert<T extends true | false, Expected extends T> = never
Asserts at compile time that the provided type argument's type resolves to the expected boolean literal type.
T
AssertFalse<T extends false> = never
Asserts at compile time that the provided type argument's type resolves to false.
T
AssertTrue<T extends true> = never
Asserts at compile time that the provided type argument's type resolves to true.
T
Has<T, U> = IsAny<T> extends true ? true : IsAny<U> extends true ? false : Extract<T, U> extends never ? false : true
Checks if type T has the specified type U.
T
IsAny<T> = 0 extends (1 & T) ? true : false
Checks if type T is the any type.
T
IsExact<T, U> = TupleMatches<AnyToBrand<T>, AnyToBrand<U>> extends true ? TupleMatches<DeepPrepareIsExact<T>, DeepPrepareIsExact<U>> extends true ? true : false : false
Checks if type T exactly matches type U.
T
IsNever<T> = [T] extends [never] ? true : false
Checks if type T is the never type.
T
IsNullable<T> = Extract<T, null | undefined> extends never ? false : true
Checks if type T is possibly null or undefined.
T
IsUnknown<T> = unknown extends T ? ([T] extends [null] ? false : true) : false
Checks if type T is the unknown type.
T
NotHas<T, U> = Has<T, U> extends false ? true : false
Checks if type T does not have the specified type U.