How to use the @accordproject/concerto-core.ModelUtil.capitalizeFirstLetter function in @accordproject/concerto-core

To help you get started, we’ve selected a few @accordproject/concerto-core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github accordproject / concerto / packages / concerto-tools / lib / codegen / fromcto / golang / golangvisitor.js View on Github external
visitField(field, parameters) {
        let array = '';

        if(field.isArray()) {
            array = '[]';
        }

        // we export all fields by capitalizing them
        parameters.fileWriter.writeLine(1, ModelUtil.capitalizeFirstLetter(field.getName()) + ' ' + array + this.toGoType(field.getType()) + ' `json:"' + field.getName() + '"`' );
        return null;
    }
github accordproject / concerto / packages / concerto-tools / lib / codegen / fromcto / golang / golangvisitor.js View on Github external
visitRelationship(relationship, parameters) {
        let array = '';

        if(relationship.isArray()) {
            array = '[]';
        }

        // we export all relationships by capitalizing them
        parameters.fileWriter.writeLine(1, ModelUtil.capitalizeFirstLetter(relationship.getName()) + ' ' + array + 'Relationship `json:"' + relationship.getName() + '"`' );
        return null;
    }
github accordproject / concerto / packages / concerto-tools / lib / codegen / fromcto / golang / golangvisitor.js View on Github external
visitEnumValueDeclaration(enumValueDeclaration, parameters) {

        // is this the first enum value?
        // if yes, we need to use 'iota' to set the value to zero
        const isFirstValue = enumValueDeclaration.getParent().getOwnProperties()[0].getName() === enumValueDeclaration.getName();
        let iota = '';

        if(isFirstValue) {
            iota =  ' ' + enumValueDeclaration.getParent().getName() + ' = 1 + iota';
        }

        // we export all fields by capitalizing them
        parameters.fileWriter.writeLine(1, ModelUtil.capitalizeFirstLetter(enumValueDeclaration.getName()) + iota );
        return null;
    }