persona-community-5/.pnpm-store/v3/files/ca/bbb93d3c7f5cb9605c326efe1de77f01776c5bf22d4d34f3e3f4d4247a09986f553417a1ebbeb32c48df58e153622810fb2f26684fa4afb7cbf707feb9ab90
rdev-worker a1d0d1bf1c
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
build: /implement-feature community-ui --requirements 'Build the React commu...
2026-02-24 08:22:30 +00:00

27 lines
562 B
Plaintext

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;