persona-community-5/.pnpm-store/v3/files/4b/f43a17962f6d74d6c841d0749f945fa2125f436e9065b2bd23be7cc805ccff6269ca10c3b637e814204ba37fab32c106daeeef9aa832bbfb3b9261d4f16950
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

25 lines
483 B
Plaintext

import type {IsNull} from './is-null';
/**
An if-else-like type that resolves depending on whether the given type is `null`.
@see {@link IsNull}
@example
```
import type {IfNull} from 'type-fest';
type ShouldBeTrue = IfNull<null>;
//=> true
type ShouldBeBar = IfNull<'not null', 'foo', 'bar'>;
//=> 'bar'
```
@category Type Guard
@category Utilities
*/
export type IfNull<T, TypeIfNull = true, TypeIfNotNull = false> = (
IsNull<T> extends true ? TypeIfNull : TypeIfNotNull
);