Type alias IsNotFunction<T, $O>

IsNotFunction<T, $O>: $SelectInvert<T, Function, $O>

🎭 predicate

Validate if T is not Function nor function signature.

Type Parameters

Example

type R = IsNotFunction<Function> // false
type R = IsNotFunction<() => void> // false

type R = IsNotFunction<never> // true
type R = IsNotFunction<unknown> // true
type R = IsNotFunction<number> // true

type R = IsNotFunction<Function | number> // boolean
type R = IsNotFunction<(() => string) | number> // boolean

🔢 customize

Filter to ensure T is not Function nor function signature, otherwise returns never.

Example

type R = IsNotFunction<Function, { selection: 'filter' }> // never
type R = IsNotFunction<() => void, { selection: 'filter' }> // never

type R = IsNotFunction<never, { selection: 'filter' }> // never
type R = IsNotFunction<unknown, { selection: 'filter' }> // unknown
type R = IsNotFunction<Function | number, { selection: 'filter' }> // number

type R = IsNotFunction<(() => string) | number, { selection: 'filter' }> // number

🔢 customize:

Disable distribution of union types.

type R = IsNotFunction<Function | 1> // boolean
type R = IsNotFunction<Function | 1, { distributive: false }> // false

🔢 customize

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

Example

type R = IsNotFunction<Function, $SelectionBranch> // $Then
type R = IsNotFunction<string, $SelectionBranch> // $Else

Generated using TypeDoc