All deprecated functions and methods are deleted:
Result.isOkAndAsync
Result.isErrAndAsync
Result.mapAsync
Result.mapOrAsync
Result.mapOrElseAsync
Result.mapErrAsync
Result.inspectAsync
Result.inspectErrAsync
Result.unwrapOrElseAsync
Result.andThenAsync
Result.orElseAsync
resultify
resultify.sync
resultify.promise
Add new package exports for jest
:
rustlike-result/cjs
rustlike-result/cjs/serializr
Add new factory fromPromiseableResult
Add asynchronous Result ResultAsync
, support these methods:
ResultAsync.isOk
ResultAsync.isOkAnd
ResultAsync.isErr
ResultAsync.isErrAnd
ResultAsync.ok
ResultAsync.err
ResultAsync.map
ResultAsync.mapOr
ResultAsync.mapOrElse
ResultAsync.mapErr
ResultAsync.inspect
ResultAsync.inspectErr
ResultAsync.expect
ResultAsync.unwrap
ResultAsync.expectErr
ResultAsync.unwrapErr
ResultAsync.unwrapOr
ResultAsync.unwrapOrElse
ResultAsync.unwrapUnchecked
ResultAsync.unwrapErrUnchecked
ResultAsync.and
ResultAsync.andThen
ResultAsync.or
ResultAsync.orElse
ResultAsync.transpose
ResultAsync.equal
Add new factories:
OkAsync
ErrAsync
Support new methods for Result
:
Result.async
Add new resultifying helpers:
resultifyAsync
resultifySync
resultifyPromise
These methods are deprecated:
Result.isOkAndAsync
Result.isErrAndAsync
Result.mapAsync
Result.mapOrAsync
Result.mapOrElseAsync
Result.mapErrAsync
Result.inspectAsync
Result.inspectErrAsync
Result.unwrapOrElseAsync
Result.andThenAsync
Result.orElseAsync
These helpers are deprecated:
resultify
resultify.sync
resultify.promise
- Narrow down
Result
type afterisOk
orisErr
- Remove type limit of
equal
method - Add doc examples for Rust-like Result methods
Support new methods:
inspectAsync
inspectErrAsync
Optional
type is no longer exported, you can just simply writeT | undefined
.
Support new methods:
inspect
inspectErr
Correct exports
in package.json, run commonjs code in Node.js environment, while the bundlers can still bundle the fake esm code.
Add async methods:
isOkAndAsync
isErrAndAsync
mapAsync
mapOrAsync
mapOrElseAsync
mapErrAsync
unwrapOrElseAsync
andThenAsync
orElseAsync
Adds JSON serialization and deserialization support with these functions:
ResultJSON.serialize
ResultJSON.deserialize
createResultModelSchema
resultPropSchema
Adds resultify help funtions
resultify
resultify.sync
resultify.promise
Implements Result
with these methods:
- isOk
- isOkAnd
- isErr
- isErrAnd
- ok
- err
- map
- mapOr
- mapOrElse
- mapErr
- expect
- unwrap
- expectErr
- unwrapErr
- unwrapOr
- unwrapOrElse
- unwrapUnchecked
- unwrapErrUnchecked
- and
- andThen
- or
- orElse
- transpose
Implements Ok
and Err
to create Result