API Reference
This reference is generated from the source with TypeDoc at build time.
Packages
- unthrown — the core
Result/AsyncResulttypes, constructors (Ok,Err— aDefecthas no constructor; it arises only at boundaries), guards, boundary interop (fromNullable,fromThrowable,fromSafeThrowable,fromPromise,fromSafePromise), aggregation (all/allFromDict), the tagged-error factory (TaggedError), and the built-inmatch/P(P.tagincluded) that drive the exhaustive error matcher. - @unthrown/vitest — custom Vitest matchers (
toBeOk,toBeOkWith,toBeErr,toBeErrWith,toBeErrTagged,toBeDefect). - @unthrown/effect — bijective
Result ↔ Exitbridges (Effect has a genuine defect channel,Cause.die), plustoEitherwith a mandatoryonDefect. - @unthrown/neverthrow —
to*/from*bridges to neverthrow'sResult/ResultAsync; everyto*takes a mandatoryonDefect(neverthrow has no defect channel). - @unthrown/boxed —
to*/from*bridges to Boxed'sResult/Future; everyto*takes a mandatoryonDefect. - @unthrown/standard-schema —
fromSchema/fromSchemaAsync: run any Standard Schema validator (Zod, Valibot, ArkType) into aResultwith the validation issues as the modeled error. - @unthrown/orpc — the oRPC (v2) bridge:
handlerResult/.result()forResult-returning procedure handlers,createResultClient/fromCallfor anAsyncResultclient, with the inferableORPCErrorunion as the modeled error. - @unthrown/prisma — a Prisma Client extension (
$extends(unthrownPrisma)) addingtry*variants of every model operation (each anAsyncResultwhose error channel is exactly the P-codes it can raise), plus$tryTransactionandtryPaginate(...).withCursor(...). - @unthrown/drizzle — a Drizzle ORM Postgres database that replaces the stock one: every query resolves to an
AsyncResult, with the five integrity-constraint SQLSTATEs as tagged errors, reads declaringE = never, andResult-driven transactions.
@unthrown/oxlint (the recommended rules no-ambiguous-error-type, no-catch-all-pattern, no-unhandled-result, no-unused-matcher, prefer-async-result, and the opt-in no-throw / prefer-ensure) has no generated API page — it is documented in the Linting guide.