Files
backend/.pnpm-store/v10/files/02/e60bda4812e983f4f8c049f2c8f15f89b7077e31ae26b3ebcb058fdddfc354f7671da924609c98db73856cc2598b9ae530492dccb065c2678d6f05156af644
T
2026-03-22 13:31:39 +00:00

29 lines
599 B
Plaintext

import type {IsNull} from './is-null.d.ts';
/**
An if-else-like type that resolves depending on whether the given type is `null`.
@deprecated This type will be removed in the next major version. Use the {@link If} type instead.
@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
);
export {};