unthrown
unthrown copied to clipboard
fix(core): qualify and constrain fromNullable absence callbacks
Problem
fromNullable directly calls onAbsent outside a boundary. A throwing absence factory escapes instead of returning Defect. An async absence factory compiles as Result<never, Promise
Locations
packages/core/src/interop.ts: fromNullable
Acceptance
Capture absence-factory throws as Defects and reject thenable callback returns at compile time and runtime. Preserve laziness and behavior for null, undefined and present falsy values. Add runtime and negative type tests.
Found in the deep audit of accounting, btravstack 0.29.0 and unthrown 5.12.0.