Skip to content
/ maybe Public

TypeScript port of the Option and Result types from Rust, with support for promises

License

Notifications You must be signed in to change notification settings

Cazoo-uk/maybe

Repository files navigation

@cazoo/maybe

What is this?

This provides some utility types that help represent uncertain outcomes. More specifically: it provides TypeScript implementations of result and option types.

The API for these types is very closely modelled around the Option and Result types in Rust. These Rust types are the inspiration for this library.

We also provide some helper types for dealing with options and results in asynchronous contexts. See AsyncOption and AsyncResult for more information.

Documentation

Documentation (including an API reference) is available via GitHub Pages (here).

Contributing

Contributions are very welcome! To contribute, first set up the repository. There are instructions for this below.

Open a branch and make whatever your changes. When you're ready, open a pull request for us to review!

When contributing, make sure that any additions are covered by unit tests. If you add or modify code, please ensure that you update the documentation to match your changes.

Also see our guide to contributing.

About

TypeScript port of the Option and Result types from Rust, with support for promises

Resources

License

Stars

Watchers

Forks

Packages

No packages published