lib/lib.js
function _parse(type, obj, options)
{
    if (!obj) return _checkResult(type, lib.newError("empty " + type), obj, options);
    try {
        obj = _parseResult(type, obj, options);
    } catch(err) {
        obj = _checkResult(type, err, obj, options);
    }
    return obj;
}
function _parse(type, obj, options)
{
    if (!obj) return _checkResult(type, lib.newError("empty " + type), obj, options);
    try {
        obj = _parseResult(type, obj, options);
    } catch(err) {
        obj = _checkResult(type, err, obj, options);
    }
    return obj;
}
function _parse ( type , obj , options ) { if ( ! obj ) return _checkResult ( type , lib . newError ( "empty " + type ) , obj , options ) ; try { obj = _parseResult ( type , obj , options ) ; } catch ( err ) { obj = _checkResult ( type , err , obj , options ) ; } return obj ; }
Combined parser with type validation
Combined parser with type validation