Package: effect
Module: Context
Checks whether the provided argument is a Context.
When to use
Use to narrow an unknown value before passing it to APIs that require a
Context.
Details
This checks the runtime Context marker and does not inspect which services
the context contains.
Gotchas
This guard only proves that the value is a Context; it does not prove that
any specific service is present.
Example (Checking for contexts)
import { Context } from "effect"
import * as assert from "node:assert"
assert.strictEqual(Context.isContext(Context.empty()), true)
See
isKey for checking service keysisReference for checking references with defaultsSignature
declare const isContext: (u: unknown) => u is Context<never>
Since v2.0.0