typelab / assertions / IsObjectLiteral
type IsObjectLiteral<T> = _IsTrue<IfObjectLiteral<T, true, false>>;Checks if a given type T is an ObjectLiteral type.
| Type Parameter | Description |
|---|---|
|
|
The type to be checked. |
true if T is an ObjectLiteral type, false otherwise.
type Valid = IsObjectLiteral<{ a: number; b: string }>; // true
type Invalid = IsObjectLiteral<string[]>; // false