UNPKG

stdopt

Version:

Wrap and validate optional values

17 lines (13 loc) 273 B
var Opt = require('../opt') function string (s) { Opt.call(this, s) } string.parse = function (s) { if (typeof s === 'string') { return s } if (typeof s === 'number' || s instanceof String) { return String(s) } } module.exports = Opt.construct(string)