examples/tutorial/tutorial_spec.js
function minimizeCst(cstElement) {
            // tokenType idx is auto generated, can't assert over it
            if (cstElement.tokenType) {
                delete cstElement.tokenType
            }

            // CstNode
            if (cstElement.children !== undefined) {
                cstElement.children = _.omitBy(cstElement.children, _.isEmpty)
                _.forEach(cstElement.children, childArr => {
                    _.forEach(childArr, minimizeCst)
                })
            }

            return cstElement
        }
function minimizeCst(cstElement) {
            // tokenType idx is auto generated, can't assert over it
            if (cstElement.tokenType) {
                delete cstElement.tokenType
            }

            // CstNode
            if (cstElement.children !== undefined) {
                cstElement.children = _.omitBy(cstElement.children, _.isEmpty)
                _.forEach(cstElement.children, childArr => {
                    _.forEach(childArr, minimizeCst)
                })
            }

            return cstElement
        }
function minimizeCst ( cstElement ) { // tokenType idx is auto generated, can't assert over it if ( cstElement . tokenType ) { delete cstElement . tokenType } // CstNode if ( cstElement . children !== undefined ) { cstElement . children = _ . omitBy ( cstElement . children , _ . isEmpty ) _ . forEach ( cstElement . children , childArr => { _ . forEach ( childArr , minimizeCst ) } ) } return cstElement }
to make it easier to understand the assertions
to make it easier to understand the assertions