An open API service indexing awesome lists of open source software.

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>

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`.