Lines Matching refs:val
13 * Parse or format the given `val`.
19 * @param {String|Number} val
21 * @throws {Error} throw an error if val is not a non-empty string or a number
26 module.exports = function (val, options) {
28 var type = typeof val;
29 if (type === 'string' && val.length > 0) {
30 return parse(val);
31 } else if (type === 'number' && isFinite(val)) {
32 return options.long ? fmtLong(val) : fmtShort(val);
35 'val is not a non-empty string or a valid number. val=' +
36 JSON.stringify(val)