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.9.2 - 2026-04-12
- Performance: Added
/*#__PURE__*/annotations to all top-level function call expressions for better tree-shaking support in consumer bundlers
- Build: Migrated
treeshakeconfig from deprecated'smallest'string to object form for Vite 8 (Rolldown) compatibility - Build: Added
topLevelVar: falseto output options to preserveconstdeclarations in bundled output
- Upgraded devDependencies: vite, vitest, eslint, typedoc, typescript-eslint
1.9.1 - 2026-01-16
- Performance:
Channelbuffer replacedArraywithQueuefor O(1) shift operations
- Added
@sincetags to all public APIs - Improved JSDoc consistency and formatting
- Changed JSR publish to trigger on release instead of push to main
1.9.0 - 2026-01-04
- Try Extensions for Result:
andTryAsync<U>- LikeandThenAsync, but auto-catches exceptions/Promise rejections and converts them toErrorTryAsync<F>- LikeorElseAsync, but auto-catches exceptions in recovery logic
- Performance:
map()andmapErr()now returnthiswhen the Result variant doesn't match, avoiding unnecessary object creation
promiseToAsyncResult()- UsetryAsyncResult()instead (deprecated since v1.7.0)
1.8.0 - 2025-12-31
- New Sync Primitives:
OnceAsync<T>- Async-first one-time initialization with concurrent call handlingRwLock<T>- Async read-write lock (multiple concurrent readers or single writer)Channel<T>- MPMC (multi-producer multi-consumer) async message passing with optional bounded capacity
- New Function Types:
FnOnce<A, R>- One-time callable sync function wrapperFnOnceAsync<A, R>- One-time callable async function wrapper
- New Methods:
Option.reduce()- Rust API alignment for reducing Option to its contained valueResult.intoOk()/Result.intoErr()- Infallible extraction forResult<T, never>andResult<never, E>ControlFlow.intoValue()- Extract value when both branches have the same typeOnce.tryInsert()/Once.waitAsync()- Additional initialization controlMutex.get()/Mutex.set()/Mutex.replace()- Convenience methods
- New Type Aliases:
SafeResult<T>-Result<T, never>for operations that cannot failAsyncSafeResult<T>- Async version of SafeResult
- Iterator Protocol -
OptionandResultnow implementSymbol.iteratorforfor...ofloops:for (const value of Some(42)) { console.log(value); } // 42 for (const value of None) { /* never executes */ }
- Rust Documentation Links - All Rust-equivalent interfaces now link to official Rust docs via
@seetags
- Module Reorganization - Source code restructured into
core/(Option, Result) andstd/(sync, ops) directories, mirroring Rust's stdlib organization - Async Callback Types - All async methods now accept
PromiseLike<T> | Tinstead of justPromise<T>, allowing mixed sync/async callbacks - Async Return Types - Use
Awaited<T>to properly flatten nested Promises in async method return types - Internal Optimizations - Cached Promise constants (
ASYNC_NONE, etc.) for better runtime performance
thisbinding issue inOnce.getOrTryInitAsync- Nested Promise flattening in async methods
1.7.1 - 2025-12-26
- Argument passing - All
try*functions now support passing arguments likePromise.try:tryOption(JSON.parse, jsonString)instead oftryOption(() => JSON.parse(jsonString))tryResult(decodeURIComponent, str)instead oftryResult(() => decodeURIComponent(str))
- Unified sync/async returns -
tryAsyncOptionandtryAsyncResultnow accept functions that returnT | PromiseLike<T>, allowing mixed sync/async logic
1.7.0 - 2025-12-26
tryOption()- Capture synchronous exceptions as Option (success → Some, exception → None)tryAsyncOption()- Capture async/Promise exceptions as OptiontryResult()- Capture synchronous exceptions as Result (success → Ok, exception → Err)tryAsyncResult()- Capture async/Promise exceptions as Result
promiseToAsyncResult()- UsetryAsyncResult()instead (same functionality, more consistent naming)
1.6.2 - 2025-12-25
promiseToAsyncResultnow acceptsPromiseLike<T>instead ofPromise<T>for broader compatibility with thenable objects- Use
AsyncResulttype alias in function signatures for consistency
- Removed unused
sourcefield from package.json (Parcel legacy) - Removed redundant
@internaltags from private (non-exported) functions
1.6.1 - 2025-12-19
- License changed from GPL-3.0 to MIT for broader adoption and easier integration
- Navigation links (GitHub, npm, JSR) in TypeDoc documentation header
1.6.0 - 2025-12-18
- Sync Primitives:
Once<T>,Lazy<T>,LazyAsync<T>,Mutex<T>for Rust-style synchronization - Control Flow:
ControlFlow<B, C>withBreakandContinuevariants Symbol.toStringTagproperty to all types for better type identification- Custom
toString()method to all types for debugging isControlFlow()type guard utilityisNoneOr()andisNoneOrAsync()methods for Optionexportsfield in package.json for modern Node.js module resolution- GitHub Pages workflow for automatic API documentation deployment
- Immutability tests to verify
Object.freeze()is working correctly - 100% test coverage
- CHANGELOG.md with full version history
- All instances are now frozen with
Object.freeze()for runtime immutability - TypeDoc output format from Markdown to HTML for GitHub Pages compatibility
- Migrated from Deno test to Vitest
- Build process split into Vite (JS) and Rollup (dts)
- Symbol property syntax and duplicate declaration issues
- Type inference improvements for
Noneinterface methods
1.5.0 - 2024-08-11
- Async versions of methods:
isSomeAndAsync,isOkAndAsync,isErrAndAsync,unwrapOrElseAsync,andThenAsync,orElseAsync - Async examples
- Updated pnpm to v9.7.0
- Updated ESLint configuration
1.4.0 - 2024-08-05
Ok()constructor without arguments (similar to Rust'sOk(()))RESULT_VOIDconstant for void Result returnsVoidResult<E>,VoidIOResult,AsyncVoidResult<E>,AsyncVoidIOResulttype aliases
1.3.2 - 2024-08-04
- Renamed
helperstoutils - Improved
@exampleannotations in JSDoc
1.3.1 - 2024-08-03
mapmethods now correctly return new objects instead of mutating
- Updated Rollup to v4.20.0
1.3.0 - 2024-08-01
RESULT_TRUE,RESULT_FALSE,RESULT_ZEROconstants
- Circular dependency issues
- Reorganized code structure
1.2.0 - 2024-08-01
isOption()andisResult()type guard utilities- Custom string conversion for Option and Result
- Replaced arrow functions with normal functions for better debug experience
- Updated ESLint to v9
1.1.2 - 2024-07-17
asOk<F>()andasErr<U>()methods for type casting
1.1.1 - 2024-07-13
- TypeDoc configuration issues
- Updated dependencies
1.1.0 - 2024-06-09
Option.filter()method- Many new Option and Result APIs
- Comprehensive code comments and documentation
- Improved type inference
Option.filter()now returnsOption<T>instead of boolean
1.0.9 - 2024-05-14
- Documentation for exported symbols
- README examples
1.0.8 - 2024-05-13
- Switched from npm to pnpm
- Added GitHub Actions test workflow with Codecov
1.0.7 - 2024-05-08
Somevalue type changed toNonNullable<T>
- Can now invoke
err()fromOkvariant
1.0.6 - 2024-05-08
- Commonly used type exports
- Set
type: "module"in package.json - Build target set to ESNext
1.0.5 - 2024-05-05
- Throw
TypeErrorinstead of genericError - Switched to Rollup for building
- Added Bun support in CI
1.0.4 - 2024-05-04
- Chinese README (
README.cn.md) - JSR publishing workflow
- npm publishing workflows
- Replaced Parcel with Rollup for building
- Replaced Jest with Bun test
1.0.3 - 2024-04-27
- Installation and Examples sections in README
- Force return const for better type inference
1.0.2 - 2024-04-26
- JSR publishing support
- Improved code comments
1.0.1 - 2024-04-26
- Replaced enum with const for better tree-shaking
- Marked package as side-effect free
1.0.0 - 2024-04-24
- Initial release
Option<T>type withSomeandNonevariantsResult<T, E>type withOkandErrvariants- Full TypeScript support
- Comprehensive API matching Rust's Option and Result