nullable

plow bravely ahead!

nullable

plow bravely ahead!

var Nullable = require('nullable')
 
var foo = Nullable(null)
 
console.log(
foo.map(function (x) { return x + 5 })
  .call('toString', 16)
  .orDefault('b33f')
)
// => 'b33f' 

Constructor, may be called with or without new

Map a function fn to the value if available. Returns a Nullable of the return type of fn. Analogous to Array#map

Call a method on the underlying value if available. Returns a Nullable of the return type of the method. Additional parameters are optional and work like Function#call

Returns the underlying value if available, or the default argument specified.

Access the underlying value, if available. May be null or undefined

$ npm install nullable

From package root:

$ npm install
$ npm test

MIT. (c) MMXIII AgileMD hello@agilemd.com See LICENSE.md