Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/nickfla1/resful
Browse files Browse the repository at this point in the history
  • Loading branch information
nickfla1 committed Nov 4, 2023
2 parents 0dc9502 + f0eac0a commit 5f1aecb
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ Type safe result utilities for TypeScript.

## Who should use this library?

This library is intended for developer that want to void explicitly uses `Error` and `throw` in their TypeScript applications.
This library is intended for developers that want to void explicitly uses of `Error` and `throw` in their TypeScript applications.

If used in libraries is not advised to expose `Result` to the library public API. This library is thought for internal use only.
If used in libraries iti is not advised to expose `Result` to the library public API. This library is thought for internal use only.

## How to use

Expand All @@ -20,6 +20,8 @@ npm install resful
pnpm install resful
```

> NOTE: Not tested on Bun
### Basic usage

```ts
Expand Down Expand Up @@ -105,7 +107,7 @@ const res = ok('foobar')
unwrap(res) === 'foobar' // true
```

### `unwrap`
### `unwrapOr`

Utility to unwrap the content of a result. Returning a compatible fallback value if it's an `ErrResult`.

Expand Down

0 comments on commit 5f1aecb

Please sign in to comment.