https://github.com/imarv/option
A deno module for handling null and undefined values, inspired by Rusts Option<T>
https://github.com/imarv/option
deno typescript
Last synced: about 2 months ago
JSON representation
A deno module for handling null and undefined values, inspired by Rusts Option<T>
- Host: GitHub
- URL: https://github.com/imarv/option
- Owner: iMarv
- License: mit
- Created: 2020-05-29T22:13:20.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2022-08-30T19:25:14.000Z (almost 4 years ago)
- Last Synced: 2025-09-30T02:51:36.952Z (9 months ago)
- Topics: deno, typescript
- Language: TypeScript
- Homepage:
- Size: 31.3 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
**Note**: This is a downstream git-mirror of my personal
[fossil](https://fossil-scm.org/) repository. Changes in git won't be sent back
upstream.
# Option
Deno module inspired by Rusts `Option` to help handling `null` and
`undefined` in Typescript.
## How to use
The main idea is to type all values that are either `T | null` or
`T | undefined` into a unified `Option` and to handle either cases with the
help of `match()` and the `Matcher` class.
This allows solid type/null safety in your project without the fear of
`cannot read property name of undefined`.