packages/okam-build/lib/processor/js/transform/filter.js
function generateFilterCode(filterObjAst, t, options) {
    if (!filterObjAst.properties.length) {
        return '';
    }

    let {format = 'es6', usingBabel6} = options || {};
    let ast;
    if (format === 'es6') {
        ast = generateES6ModuleFilterCode(filterObjAst, t);
    }
    else {
        ast = generateCommonJSModuleFilterCode(filterObjAst, t);
    }

    return generateCode(ast, {
        auxiliaryCommentBefore: 'Auto generated filter code by okam'
    }, usingBabel6).code;
}
function generateFilterCode(filterObjAst, t, options) {
    if (!filterObjAst.properties.length) {
        return '';
    }

    let {format = 'es6', usingBabel6} = options || {};
    let ast;
    if (format === 'es6') {
        ast = generateES6ModuleFilterCode(filterObjAst, t);
    }
    else {
        ast = generateCommonJSModuleFilterCode(filterObjAst, t);
    }

    return generateCode(ast, {
        auxiliaryCommentBefore: 'Auto generated filter code by okam'
    }, usingBabel6).code;
}
function generateFilterCode ( filterObjAst , t , options ) { if ( ! filterObjAst . properties . length ) { return '' ; } let { format = 'es6' , usingBabel6 } = options || { } ; let ast ; if ( format === 'es6' ) { ast = generateES6ModuleFilterCode ( filterObjAst , t ) ; } else { ast = generateCommonJSModuleFilterCode ( filterObjAst , t ) ; } return generateCode ( ast , { auxiliaryCommentBefore : 'Auto generated filter code by okam' } , usingBabel6 ) . code ; }
Generated filter code

@param {Object} filterObjAst the filter definition ast
@param {Object} t the babel type definition
@param {Object=} options the generation option
@param {string=} options.format the module format, by default es6 module syntax
the supported module format: es6/commonjs
@param {boolean=} options.usingBabel6 whether using babel6 processor, by default false
@return {string}
Generated filter code