Type Alias IsNotString<T, $O>

IsNotString<T, $O>: $SpecialType<T, $MergeOptions<$O, {
    $else: IsNotString.$<T, $O>;
    $then: $ResolveBranch<T, $O, [$Then]>;
}>>

🎭 predicate

Validate if T is not string nor string literals.

Type Parameters

type R = IsNotString<string> // false
type R = IsNotString<'a'> // false

type R = IsNotString<never> // false
type R = IsNotString<unknown> // false
type R = IsNotString<string | boolean> // boolean

🔢 customize

Filter to ensure T is not string nor string literals, otherwise returns never.

type R = IsNotString<string, { selection: 'filter' }> // never
type R = IsNotString<'a', { selection: 'filter' }> // never

type R = IsNotString<never, { selection: 'filter' }> // never
type R = IsNotString<unknown, { selection: 'filter' }> // unknown
type R = IsNotString<string | boolean, { selection: 'filter' }> // boolean

🔢 customize:

Disable distribution of union types.

type R = IsNotString<string | 1> // boolean
type R = IsNotString<string | 1, { distributive: false }> // false

🔢 customize

Use unique branch identifiers to allow precise processing of the result.

type R = IsNotString<string, $IsNotString.$Branch> // $Else
type R = IsNotString<bigint, $IsNotString.$Branch> // $Then