Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
TheDudeFromCI authored and vultix committed Nov 12, 2022
1 parent d0fb55a commit 910789d
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Brings compile-time error checking and optional values to typescript.
- [Type Safety](#type-safety)
- [Unwrap](#unwrap)
- [Expect](#expect)
- [ExpectErr](#expecterr)
- [Map, MapErr](#map-and-maperr)
- [andThen](#andthen)
- [Else](#else)
Expand Down Expand Up @@ -202,6 +203,17 @@ goodResult.expect('goodResult should be a number'); // 1
badResult.expect('badResult should be a number'); // throws Error("badResult should be a number - Error: something went wrong")
```

#### ExpectErr

```typescript
let goodResult = Ok(1);
let badResult = Err(new Error('something went wrong'));

goodResult.expect('goodResult should not be a number'); // throws Error("goodResult should not be a number")
badResult.expect('badResult should not be a number'); // new Error('something went wrong')
```


#### Map and MapErr

```typescript
Expand Down

0 comments on commit 910789d

Please sign in to comment.