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)
}

Dependencies (0)

    Dev Dependencies (3)

    Package Sidebar

    Install

    npm i option-value

    Weekly Downloads

    17

    Version

    1.5.0

    License

    MIT

    Unpacked Size

    33.5 kB

    Total Files

    15

    Last publish

    Collaborators

    • owczarek