effect-io-ai

Package: effect
Module: Exit

Exit.isExit

Checks whether an unknown value is an Exit.

When to use

Use to validate unknown values at system boundaries and narrow them to Exit<unknown, unknown>.

Details

Does not inspect the contents of the Exit. Returns true for both Success and Failure exits.

Example (Checking if a value is an Exit)

import { Exit } from "effect"

console.log(Exit.isExit(Exit.succeed(42))) // true
console.log(Exit.isExit(Exit.fail("err"))) // true
console.log(Exit.isExit("not an exit"))    // false

See

Signature

declare const isExit: (u: unknown) => u is Exit<unknown, unknown>

Source

Since v2.0.0