lib/completion.js
function froms(froms) {
  var args = Array.prototype.splice.call(arguments, 0);
  if (isUndefined(froms)) {
    froms = [];
  }

  if (!isArray(froms)) {
    throw {
      name: 'Error',
      message: 'Argument is not an array',
      arguments: args
    };
  }

  var f = froms
    .filter(function (from) {
      return !isUndefined(from);
    })
    .map(function (from) {
      if (isObject(from)) {
        if (isUndefined(from.target) && isUndefined(from.default)) {
          throw {
            name: 'Error',
            message: 'from.target and from.default are both undefined',
            arguments: args
          };
        }
        if (isUndefined(from.default) && !isString(from.target)) {
          throw {
            name: 'Error',
            message: 'from.target is not a string',
            arguments: args
          };
        }
        return from;
      } else {
        return {
          target: from
        };
      };
    });

  return f;
}
function froms(froms) {
  var args = Array.prototype.splice.call(arguments, 0);
  if (isUndefined(froms)) {
    froms = [];
  }

  if (!isArray(froms)) {
    throw {
      name: 'Error',
      message: 'Argument is not an array',
      arguments: args
    };
  }

  var f = froms
    .filter(function (from) {
      return !isUndefined(from);
    })
    .map(function (from) {
      if (isObject(from)) {
        if (isUndefined(from.target) && isUndefined(from.default)) {
          throw {
            name: 'Error',
            message: 'from.target and from.default are both undefined',
            arguments: args
          };
        }
        if (isUndefined(from.default) && !isString(from.target)) {
          throw {
            name: 'Error',
            message: 'from.target is not a string',
            arguments: args
          };
        }
        return from;
      } else {
        return {
          target: from
        };
      };
    });

  return f;
}
function froms ( froms ) { var args = Array . prototype . splice . call ( arguments , 0 ) ; if ( isUndefined ( froms ) ) { froms = [ ] ; } if ( ! isArray ( froms ) ) { throw { name : 'Error' , message : 'Argument is not an array' , arguments : args } ; } var f = froms . filter ( function ( from ) { return ! isUndefined ( from ) ; } ) . map ( function ( from ) { if ( isObject ( from ) ) { if ( isUndefined ( from . target ) && isUndefined ( from . default ) ) { throw { name : 'Error' , message : 'from.target and from.default are both undefined' , arguments : args } ; } if ( isUndefined ( from . default ) && ! isString ( from . target ) ) { throw { name : 'Error' , message : 'from.target is not a string' , arguments : args } ; } return from ; } else { return { target : from } ; } ; } ) ; return f ; }
Helper function which returns an array of
Helper function which returns an array of