option-value
TypeScript icon, indicating that this package has built-in type declarations

1.5.0 • Public • Published

option-value

Handle nullable values in more convenient functional way.

Links:

npm | GitHub

Example usage:

import { Maybe } from 'option-value'

function func(): string | null { ... }
function process(value: string) { ... }

// Use
Maybe(func()).ifPresent(process)

// Instead of
let maybeString: string | null = func()
if (maybeString != null) {
  process(maybeString)
}

Package Sidebar

Install

npm i option-value

Weekly Downloads

2

Version

1.5.0

License

MIT

Unpacked Size

33.5 kB

Total Files

15

Last publish

Collaborators

  • owczarek