Sha256: ba93f0192c9c30d895bee1141dd0c307b75df16245deef7134ac0152294788cc
Contents?: true
Size: 562 Bytes
Versions: 28
Compression:
Stored size: 562 Bytes
Contents
import type {IsEmptyObject} from './empty-object'; /** An if-else-like type that resolves depending on whether the given type is `{}`. @see {@link IsEmptyObject} @example ``` import type {IfEmptyObject} from 'type-fest'; type ShouldBeTrue = IfEmptyObject<{}>; //=> true type ShouldBeBar = IfEmptyObject<{key: any}, 'foo', 'bar'>; //=> 'bar' ``` @category Type Guard @category Utilities */ export type IfEmptyObject< T, TypeIfEmptyObject = true, TypeIfNotEmptyObject = false, > = IsEmptyObject<T> extends true ? TypeIfEmptyObject : TypeIfNotEmptyObject;
Version data entries
28 entries across 28 versions & 2 rubygems