Skip to main content

Type Alias: IsNarrowable<T, U>

type IsNarrowable<T, U>: IsNever<T extends U ? true : false & U extends T ? false : true> extends true ? false : true;

Type Parameters

Type ParameterDescription

T

Type to check

U

Type to against

Description

Checks if T can be narrowed further than U

Example

type Result = IsNarrowable<'foo', string>
// ^? true

Defined

@nilfoundation/niljs/src/types/utils.ts:46