function reconstituteType(name, typeSpec) {
    if (name.substr(-2) === '[]') { // i.e. endsWith('[]')
        var subtypeName = name.slice(0, -2);
        return new types['array'](subtypeName);
    }

    var type = types[name];
    if (typeof type === 'function') {
        type = new type(typeSpec);
    }
    return type;
}
function reconstituteType(name, typeSpec) {
    if (name.substr(-2) === '[]') { 
        var subtypeName = name.slice(0, -2);
        return new types['array'](subtypeName);
    }

    var type = types[name];
    if (typeof type === 'function') {
        type = new type(typeSpec);
    }
    return type;
}
function reconstituteType ( name , typeSpec ) { if ( name . substr ( - 2 ) === '[]' ) { // i.e. endsWith('[]') var subtypeName = name . slice ( 0 , - 2 ) ; return new types [ 'array' ] ( subtypeName ) ; } var type = types [ name ] ; if ( typeof type === 'function' ) { type = new type ( typeSpec ) ; } return type ; }
See description of #exports.registerType()
See description of #exports . registerType ()