nullable-value

0.2.0 • Public • Published

Nullable

Build Status

What

A tiny javascript wrapper the result which may be undefined or null

Why

we have lots of boilerplate code to handle empty value

doAsync(function(result) {
    // if result is empty then crap....
    result.forEach(function() {
    });
});
 
so we can do this
doAsync(function(result) {
    var result = Nullable(result).def([]).val;
    // if result is empty, then nothing happened
    result.forEach(function(item) {
    });
});

Readme

Keywords

Package Sidebar

Install

npm i nullable-value

Weekly Downloads

0

Version

0.2.0

License

none

Last publish

Collaborators

  • xujihui1985