Releases: kennethnym/trycat
Releases · kennethnym/trycat
0.2.4
This release fixes incorrect cjs/mjs exports in package.json.
0.2.3
This release updates unwrap/unwrapErr/expect/expectErr messages to match Rust's implementation:
unwraponErrnow throws an error with the error message being the containing error value- e.g.
err("emergency").unwrap()throws anErrorwithemergencyas the message
- e.g.
unwrapErronOknow throws an error with the error message being the containing value- e.g.
ok(123).unwrapErr()throws anErrorwith123as the message
- e.g.
expectonErrnow throws an error with the provided message and the containing error value as the message- e.g.
err("failed").expect("should not fail")throws anErrorwithshould not failed: failedas the message
- e.g.
expectErronOknow throws an error with the provided message and the containing value as the message- e.g.
ok("hello").expectErr("should fail")throws anErrorwithshould fail: helloas the message
- e.g.
0.2.2
- Fixed an issue where
tryswould always infer the passed function as() => void, thus causing the return type to always beResult<void, unknown>. Now,trysshould correctly infer the return type of the function as expected - Corrected some mistakes in README and some housekeeping
0.2.1
You can now return an empty ok or err:
function someWork(): Result<void, void> {
// ... stuff
if (someError) {
return err()
}
// ... more stuff
return ok()
}trys and tryp will now also infer the void type correctly if the given function and promise returns void
0.2.0
This release fixes the issue where the transpiled JS code is not published to npm.
v0.1.0
Initial release