Skip to main content

IfNever<T, TypeIfNever, TypeIfNotNever>

IfNever<T, TypeIfNever, TypeIfNotNever> = IsNever<T> extends true ? TypeIfNever : TypeIfNotNever

Defined in: packages/react-querybuilder/src/types/type-fest/if-never.ts:21

An if-else-like type that resolves depending on whether the given type is never.

Type Parameters

Type ParameterDefault type
T-
TypeIfNevertrue
TypeIfNotNeverfalse

See

IsNever

Example

import type {IfNever} from 'type-fest';

type ShouldBeTrue = IfNever<never>;
//=> true

type ShouldBeBar = IfNever<'not never', 'foo', 'bar'>;
//=> 'bar'

caution

API documentation is generated from the latest commit on the main branch. It may be somewhat inconsistent with official releases of React Query Builder.