monapt-type-safe
TypeScript icon, indicating that this package has built-in type declarations

0.0.4 • Public • Published

Type Safe Monapt

npm version

Monapt helps you better manage null, undefined, exceptions, and other mildly interesting phenomena. It handles them through the Option, Try, and Future abstractions.

Setup

$ npm install type-safe-monapt

APIs

Usage

import { Option } from 'type-safe-monapt';

Option(1)
  .map((x) => x * 2)
  .getOrElse(() => 4);

You can also take a look at the tests to get a feel for how to use them.

Credits

This repo couldn't have been possible without jiaweihli/monapt. I'm merely adding types to Monapt so reading data is implemented correctly and we have feedback at compile time.

Package Sidebar

Install

npm i monapt-type-safe

Weekly Downloads

6

Version

0.0.4

License

MIT

Unpacked Size

31.7 kB

Total Files

12

Last publish

Collaborators

  • giovanni.gardusi