dist/index.js
function(val, options) {
  options = options || {};
  var type = typeof val;
  if (type === 'string' && val.length > 0) {
    return parse$3(val);
  } else if (type === 'number' && isNaN(val) === false) {
    return options.long ? fmtLong$2(val) : fmtShort$2(val);
  }
  throw new Error(
    'val is not a non-empty string or a valid number. val=' +
      JSON.stringify(val)
  );
}
function(val, options) {
  options = options || {};
  var type = typeof val;
  if (type === 'string' && val.length > 0) {
    return parse$3(val);
  } else if (type === 'number' && isNaN(val) === false) {
    return options.long ? fmtLong$2(val) : fmtShort$2(val);
  }
  throw new Error(
    'val is not a non-empty string or a valid number. val=' +
      JSON.stringify(val)
  );
}
Parse or format the given `val`.

Options:

- `long` verbose formatting [false]

@param {String|Number} val
@param {Object} [options]
@throws {Error} throw an error if val is not a non-empty string or a number
@return {String|Number}
@api public