Skip to content

Latest commit

 

History

History
43 lines (31 loc) · 543 Bytes

File metadata and controls

43 lines (31 loc) · 543 Bytes

typelab / assertions / IsNonNullish

type IsNonNullish<T> = IfNonNullish<T, true, false>;

Checks if a given type T is a {} type.

Type Parameters

Type Parameter Description

T

The type to be checked.

Returns

true if T is a {} type, false otherwise.

Example

type Valid = IsNonNullish<{}>; // true
type Invalid = IsNonNullish<string>; // false