Skip to content

Latest commit

 

History

History
43 lines (31 loc) · 615 Bytes

File metadata and controls

43 lines (31 loc) · 615 Bytes

typelab / assertions / IsObjectLiteral

type IsObjectLiteral<T> = _IsTrue<IfObjectLiteral<T, true, false>>;

Checks if a given type T is an ObjectLiteral type.

Type Parameters

Type Parameter Description

T

The type to be checked.

Returns

true if T is an ObjectLiteral type, false otherwise.

Example

type Valid = IsObjectLiteral<{ a: number; b: string }>; // true
type Invalid = IsObjectLiteral<string[]>; // false