effect-io-ai

Package: effect
Module: Types

Types.NotFunction

Excludes function types from a union, keeping only non-function members.

When to use

Use to filter out callable types from a union.

Details

Returns never if the entire union consists of function types.

Example (Filtering out functions)

import type { Types } from "effect"

type Result = Types.NotFunction<string | (() => void) | number>
// string | number

Signature

type NotFunction<T> = T extends Function ? never : T

Source

Since v2.0.0