Skip to content

Releases: OliverBrotchie/optionals

Convenience helpers and improved spec compliance

Choose a tag to compare

@OliverBrotchie OliverBrotchie released this 01 Nov 01:02
dd58d6e

This release brings some excellent feature suggestions from @aaronhuggins (#6) and brings this library's implementation closer to the Rust specification! This version will be released on NPM for greater availability of consumption.

Additions

Convenience helpers

  • from - Breaking Changes, diverges to from (synchronous) and fromAsync (asynchronous) methods to avoid the creation of unnecessary microtasks.
  • Symbol.toStringTag - Adds toString support which is useful in quickly and easily distinguishing resulting objects.
  • Symbol.hasInstance - Adds instanceof support to Ok, Err, Some and None.

Spec compliance

  • Iterator - Provides iterator deserialization by yielding the internal value if the internal value is not an Err or None.
  • Result.expectErr - An extra method to expect an Err result.
  • ok - A method to convert from Result<T, E> to Option<T>.
  • okOr - A method to convert from Option<T> to Result<T, E>.

May you have a blessed day! ❤️

Small doc change

Choose a tag to compare

@OliverBrotchie OliverBrotchie released this 10 Oct 10:54
v2.0.2

Small doc change

Small Readme update

Choose a tag to compare

@OliverBrotchie OliverBrotchie released this 10 Oct 10:47
v2.0.1

Small Readme change

Class-based reimplementation

Choose a tag to compare

@OliverBrotchie OliverBrotchie released this 10 Oct 10:37
32cc3e2

Optionals 2.0.0 reimplementation changes Result and Option into simple but expressive classes.

Hard Types

Choose a tag to compare

@OliverBrotchie OliverBrotchie released this 01 Oct 15:04
e659742

Splits the API into Soft and Hard types. Hard types allow for rust-like exhaustive matching! See READMEs for more details.

Moved from unknown to generic optionals

Choose a tag to compare

@OliverBrotchie OliverBrotchie released this 25 Sep 12:09
v1.0.3

Update mod.ts

Generics and full documentation

Choose a tag to compare

@OliverBrotchie OliverBrotchie released this 24 Sep 17:04
be66dfd
v1.0.2

Update README.md

Readme Fix

Choose a tag to compare

@OliverBrotchie OliverBrotchie released this 24 Sep 05:50
b5a8127
v1.0.1

Update README.md

Initial Release

Choose a tag to compare

@OliverBrotchie OliverBrotchie released this 24 Sep 05:48
717bcd8
v1.0.0

Update README.md