Changelog
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
1.2.0 - 2025-12-15
Added
Validation methods:
Result.validate()- Create Result by validating value with predicateResult.fromNullable()- Create Result from nullable valuesResult.isResult()- Type guard for Result instancesisOkAnd()/isErrAnd()- Validate Result with predicates
Collection methods:
Result.allSettled()- Collect all Results without failingResult.any()- Return first Ok or all errorsResult.partition()- Separate successes and failuresResult.values()/Result.errors()- Extract values or errors
Transformation methods:
filter()- Filter Ok values by predicatezip()- Combine two Results into tuple
Async methods:
mapAsync(),mapErrAsync(),mapOrAsync(),mapOrElseAsync()andThenAsync(),andAsync(),orAsync(),orElseAsync()
Other methods:
contains()/containsErr()- Check for specific values/errorsinspectErr()- Side effects on errorstoJSON()- JSON conversion
VitePress documentation with comprehensive JSDoc comments
Changed
- BREAKING: Complete rewrite with
OkandErrclasses - BREAKING:
Result.sequence()→Result.all() - BREAKING:
Result.is()→Result.isResult() - BREAKING: Errors now throw with
causeproperty - Module exports use
.jsextension (was.mjs) - Homepage now points to documentation site
typesscript renamed totypecheck
Removed
- BREAKING:
Result.sequenceAsync()(use async methods instead) - BREAKING:
inspectOk()(usematch()orinspect()instead)
1.1.0 - 2025-11-20
Added
Result.sequence()- Combines multiple Results into single Result with array of valuesResult.sequenceAsync()- Async version of sequence for Promise-based ResultsResult.fromPromise()- Converts Promises to Results, catching rejectionsResult.fromTry()- Wraps functions that may throw into Results
Changed
unwrap()now throws the original error directly instead of wrapping itexpect()now includes the original error ascausefor better error tracing
1.0.0 - 2025-11-20
First stable version for production use.