effect-io-ai

Package: effect
Module: Cause

Cause.isReason

Checks whether an arbitrary value is a Reason (Fail, Die, or Interrupt).

Example (Checking the runtime type)

import { Cause } from "effect"

const reason = Cause.fail("error").reasons[0]
console.log(Cause.isReason(reason)) // true
console.log(Cause.isReason("not a reason")) // false

Signature

declare const isReason: (self: unknown) => self is Reason<unknown>

Source

Since v4.0.0