build/generate.js
function buildType(t, typeClassification) {
            let typeDef;
            switch (typeClassification) {
                case 'primative':
                    typeDef = {
                        interface: t,
                        builder: t
                    };
                    break;
                case 'message':
                    typeDef = {
                        interface: '$Subtype<' + t + 'Interface>',
                        builder: t + 'Builder'
                    };
                    break;
                case 'enum':
                    typeDef = {
                        interface: t + 'Values',
                        builder: t + 'Values'
                    };
                    break;
                default:
                    throw new Error('Unhandled classification case :: ' + typeClassification);
            }
            if (repeated) {
                for (const key in typeDef) {
                    typeDef[key] = 'Array<' + typeDef[key] + '>';
                }
            }
            return typeDef;
        }
function buildType(t, typeClassification) {
            let typeDef;
            switch (typeClassification) {
                case 'primative':
                    typeDef = {
                        interface: t,
                        builder: t
                    };
                    break;
                case 'message':
                    typeDef = {
                        interface: '$Subtype<' + t + 'Interface>',
                        builder: t + 'Builder'
                    };
                    break;
                case 'enum':
                    typeDef = {
                        interface: t + 'Values',
                        builder: t + 'Values'
                    };
                    break;
                default:
                    throw new Error('Unhandled classification case :: ' + typeClassification);
            }
            if (repeated) {
                for (const key in typeDef) {
                    typeDef[key] = 'Array<' + typeDef[key] + '>';
                }
            }
            return typeDef;
        }
function buildType ( t , typeClassification ) { let typeDef ; switch ( typeClassification ) { case 'primative' : typeDef = { interface : t , builder : t } ; break ; case 'message' : typeDef = { interface : '$Subtype<' + t + 'Interface>' , builder : t + 'Builder' } ; break ; case 'enum' : typeDef = { interface : t + 'Values' , builder : t + 'Values' } ; break ; default : throw new Error ( 'Unhandled classification case :: ' + typeClassification ) ; } if ( repeated ) { for ( const key in typeDef ) { typeDef [ key ] = 'Array<' + typeDef [ key ] + '>' ; } } return typeDef ; }
Builds the typedef needed for the template

@param t - base type name
@param primative - is it a built in type - i.e. leave it alone
@returns {{interface: string, builder: string}}
Builds the typedef needed for the template