How to use the is2.nullOrUndef function in is2

To help you get started, we’ve selected a few is2 examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github strongloop / supercluster / lib / WorkerRunCommon.js View on Github external
exports.runCmds = function(cmds, dir, cb) {

  // it's valid to send no commands, you just get empty results.
  if (is.nullOrUndef(cmds))
    return cb(null, [], []);

  if (!is.array(cmds))
    return cb(new Error('Bad cmds parameter: '+inspect(cmds)));

  if (!is.func(cb))
    return cb(new Error('Bad cb parameter: '+inspect(cb)));

  // one for each entry in the array
  var outputs = [];
  var codes = [];

  // iterator function for async.eachSeries
  var iterator = function(cmd, cb) {
    // default directorry is the cwd
    if (!is.nonEmptyStr(cmd.dir))  cmd.dir = dir;

is2

A type checking library where each exported function returns either true or false and does not throw. Also added tests.

MIT
Latest version published 2 years ago

Package Health Score

68 / 100
Full package analysis