Skip to content

Commit

Permalink
bump version to v0.4.4
Browse files Browse the repository at this point in the history
  • Loading branch information
yifanwww committed Jun 8, 2024
1 parent bae6f47 commit 1c0db2b
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 7 deletions.
63 changes: 63 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,67 @@
# CHANGELOG
## rustlike-result v0.4.4 (2024-06-08)
### Features

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`

### Notable Changes

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`

## rustlike-result v0.4.3 (2024-04-14)
### Features

Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ Rust-like `Result` and `ResultAsync` for JavaScript.
- [`ResultAsync.equal`](#resultasyncequal)
- [`Result.async`](#resultasync)
- [Helpers for Resultifying](#helpers-for-resultifying)
- [resultifyAsync](#resultifyasync)
- [resultifySync](#resultifysync)
- [resultifyPromise](#resultifypromise)
- [`resultifyAsync`](#resultifyasync)
- [`resultifySync`](#resultifysync)
- [`resultifyPromise`](#resultifypromise)
- [JSON Serialization \& Deserialization](#json-serialization--deserialization)
- [Built-in Simple Implementation](#built-in-simple-implementation)
- [Community (De)Serialization Solutions](#community-deserialization-solutions)
Expand Down Expand Up @@ -1278,7 +1278,7 @@ assert(num === 9);
```

## Helpers for Resultifying
### resultifyAsync
### `resultifyAsync`

Takes a function and returns a version that returns results asynchronously.

Expand All @@ -1290,7 +1290,7 @@ const copyFile1 = resultifyAsync(fs.copyFile);
const copyFile2 = resultifyAsync<Error>()(fs.copyFile);
```

### resultifySync
### `resultifySync`

Takes a function and returns a version that returns results synchronously.

Expand All @@ -1310,7 +1310,7 @@ const fn1 = resultifySync<Error>()(fn);

In the context where async functions are not allowed, you can use this function to resultify the sync function.

### resultifyPromise
### `resultifyPromise`

Takes a promise and returns a new promise that contains a result.

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rustlike-result",
"version": "0.4.3",
"version": "0.4.4",
"description": "Rust-like Result for Javascript",
"exports": {
".": {
Expand Down

0 comments on commit 1c0db2b

Please sign in to comment.