tasks/deploy/parse.js
function parseClass (ast, content) {
    let appendNode = null;
    let appendName = '';
    let constructorNode = null;
    let constructorName = '';

    for (let i = 0, max = ast.body.length; i < max; i++) {
        let node = ast.body[i];

        if (!isExpressionStatement(node) || !isAssignmentExpression(node.expression)) { continue; }

        node = node.expression;

        // Search for constructor -> CLASS.Module = function () {};
        if (isIdentifier(node.left.object) && isIdentifier(node.left.property) && node.left.object.name === 'CLASS') {
            constructorNode = node;
            constructorName = node.left.property.name;

        // Search for append -> CLASS.Module.append = {};
        } else if (isMemberExpression(node.left.object)) {
            let subNode = node.left;

            if (isIdentifier(subNode.object.object) && isIdentifier(subNode.object.property)) {
                if (subNode.object.object.name !== 'CLASS' || subNode.property.name !== 'append') { continue; }

                appendNode = node;
                appendName = subNode.object.property.name;
            }
        }
    }

    // If no constructor or append node is found or if the constructor and
    // append name do not match then don't create the hierarchy node.
    if (constructorNode === null || appendNode === null) {
        return false;
    } else if (constructorName !== appendName) {
        return false;
    }

    createHierarchyNode(constructorName);

    let hierarchyNode = hierarchy[constructorName];

    hierarchyNode.content = content;
    hierarchyNode.appendNode = appendNode;
    hierarchyNode.constructorNode = constructorNode;

    return true;
}
function parseClass (ast, content) {
    let appendNode = null;
    let appendName = '';
    let constructorNode = null;
    let constructorName = '';

    for (let i = 0, max = ast.body.length; i < max; i++) {
        let node = ast.body[i];

        if (!isExpressionStatement(node) || !isAssignmentExpression(node.expression)) { continue; }

        node = node.expression;

        // Search for constructor -> CLASS.Module = function () {};
        if (isIdentifier(node.left.object) && isIdentifier(node.left.property) && node.left.object.name === 'CLASS') {
            constructorNode = node;
            constructorName = node.left.property.name;

        // Search for append -> CLASS.Module.append = {};
        } else if (isMemberExpression(node.left.object)) {
            let subNode = node.left;

            if (isIdentifier(subNode.object.object) && isIdentifier(subNode.object.property)) {
                if (subNode.object.object.name !== 'CLASS' || subNode.property.name !== 'append') { continue; }

                appendNode = node;
                appendName = subNode.object.property.name;
            }
        }
    }

    // If no constructor or append node is found or if the constructor and
    // append name do not match then don't create the hierarchy node.
    if (constructorNode === null || appendNode === null) {
        return false;
    } else if (constructorName !== appendName) {
        return false;
    }

    createHierarchyNode(constructorName);

    let hierarchyNode = hierarchy[constructorName];

    hierarchyNode.content = content;
    hierarchyNode.appendNode = appendNode;
    hierarchyNode.constructorNode = constructorNode;

    return true;
}
function parseClass ( ast , content ) { let appendNode = null ; let appendName = '' ; let constructorNode = null ; let constructorName = '' ; for ( let i = 0 , max = ast . body . length ; i < max ; i ++ ) { let node = ast . body [ i ] ; if ( ! isExpressionStatement ( node ) || ! isAssignmentExpression ( node . expression ) ) { continue ; } node = node . expression ; // Search for constructor -> CLASS.Module = function () {}; if ( isIdentifier ( node . left . object ) && isIdentifier ( node . left . property ) && node . left . object . name === 'CLASS' ) { constructorNode = node ; constructorName = node . left . property . name ; // Search for append -> CLASS.Module.append = {}; } else if ( isMemberExpression ( node . left . object ) ) { let subNode = node . left ; if ( isIdentifier ( subNode . object . object ) && isIdentifier ( subNode . object . property ) ) { if ( subNode . object . object . name !== 'CLASS' || subNode . property . name !== 'append' ) { continue ; } appendNode = node ; appendName = subNode . object . property . name ; } } } // If no constructor or append node is found or if the constructor and // append name do not match then don't create the hierarchy node. if ( constructorNode === null || appendNode === null ) { return false ; } else if ( constructorName !== appendName ) { return false ; } createHierarchyNode ( constructorName ) ; let hierarchyNode = hierarchy [ constructorName ] ; hierarchyNode . content = content ; hierarchyNode . appendNode = appendNode ; hierarchyNode . constructorNode = constructorNode ; return true ; }
Search for top level CLASS constructor and append assignment expressions.

@function parseClass
@param {Object} ast
@param {String} content
@return {Boolean}
@api private
Search for top level CLASS constructor and append assignment expressions .