IsEmptyObject: T extends EmptyObject ? true : false

Returns a boolean for whether the type is strictly equal to an empty plain object, the {} value.

Type Parameters

  • T
import type {IsEmptyObject} from 'type-fest';

type Pass = IsEmptyObject<{}>; //=> true
type Fail = IsEmptyObject<[]>; //=> false
type Fail = IsEmptyObject<null>; //=> false

EmptyObject