cli/existingentitymodifier.js
/**
     * Parse a CRUD entity with UglifyJS and find the value of the property passed
     * @param  {string} code        javascript code to parse
     * @param  {string} entityName  CRUD Entity to modify
     * @param  {string} property    property to modify
     * @return {UglifyJS.AST_Node}  Uglifyjs node for the property value
     */
Parse a CRUD entity with UglifyJS and find the value of the property passed
@param  {string} code        javascript code to parse
@param  {string} entityName  CRUD Entity to modify
@param  {string} property    property to modify
@return {UglifyJS.AST_Node}  Uglifyjs node for the property value
Parse a CRUD entity with UglifyJS and find the value of the property passed @param { string } code javascript code to parse @param { string } entityName CRUD Entity to modify @param { string } property property to modify @return { UglifyJS . AST_Node } Uglifyjs node for the property value
function parse_crud_entity_property(code, entityName, property) {
        var output = null;
        var ast = UglifyJS.parse(code);
        ast.walk(new UglifyJS.TreeWalker(function(node) {
            if (node instanceof UglifyJS.AST_Call && node.start.value == 'CRUD' && node.expression.property == 'define' && node.args[0].start.value == entityName) {
                node.args[1].properties.map(function(node) {
                    if (node.key == property) {
                        output = node;
                    }
                });
            }
        }));
        return output;
    }
function parse_crud_entity_property ( code , entityName , property ) { var output = null ; var ast = UglifyJS . parse ( code ) ; ast . walk ( new UglifyJS . TreeWalker ( function ( node ) { if ( node instanceof UglifyJS . AST_Call && node . start . value == 'CRUD' && node . expression . property == 'define' && node . args [ 0 ] . start . value == entityName ) { node . args [ 1 ] . properties . map ( function ( node ) { if ( node . key == property ) { output = node ; } } ) ; } } ) ) ; return output ; }
Parse a CRUD entity with UglifyJS and find the value of the property passed
 @param  {string} code        javascript code to parse
 @param  {string} entityName  CRUD Entity to modify
 @param  {string} property    property to modify
 @return {UglifyJS.AST_Node}  Uglifyjs node for the property value
Parse a CRUD entity with UglifyJS and find the value of the property passed @param { string } code javascript code to parse @param { string } entityName CRUD Entity to modify @param { string } property property to modify @return { UglifyJS . AST_Node } Uglifyjs node for the property value
// search for CRUD.define calls // iterate the properties passed to the CRUD.define (second arguments) and store the ast node if found for later returning