@pixelhandler/ts-maybe
TypeScript icon, indicating that this package has built-in type declarations

1.0.3 • Public • Published

TS-Maybe

An option type Maybe<Just|Nothing> in TypeScript

Why Maybe ?

What is a Maybe?

  • Maybe<Just|Nothing> provides safe handling of null|undefined or any value
  • A Maybe implements Pointed Functor, an Applicative, and Monad interfaces
  • Also known as a nullable type as Option<Some|None>

Interfaces and Maybe type inspired by:

Functional programming resources:

Development

Use LTS version of Node.js

Clone the repo then, within the project root, run:

  • npm install

Testing

This boilerplate setup uses TypeScript and Tape as a test runner.

Use node scripts in package.json file

  • Check syntax npm run lint
  • Run tests npm run test
  • Watch changes and run tests npm run watch

Package Sidebar

Install

npm i @pixelhandler/ts-maybe

Weekly Downloads

0

Version

1.0.3

License

Apache-2.0

Unpacked Size

23.9 kB

Total Files

23

Last publish

Collaborators

  • pixelhandler