lib/api.route.handler.js
function traverseFilters(config, levels, levelIdx) {
    var lastIdx = levels.length - 1;
    var val, filters;

    if (!config || levelIdx > lastIdx) { return null; }

    val = config[levels[levelIdx]];


    if (levelIdx === lastIdx) {
        if (val) {
            return val;
        }
        else {
            return config.all;
        }
    }
    else {
        filters = traverseFilters(val, levels, levelIdx + 1);
        if (!filters) {
            filters = traverseFilters(config.all, levels, levelIdx + 1);
        }
        return filters;
    }
}
function traverseFilters(config, levels, levelIdx) {
    var lastIdx = levels.length - 1;
    var val, filters;

    if (!config || levelIdx > lastIdx) { return null; }

    val = config[levels[levelIdx]];


    if (levelIdx === lastIdx) {
        if (val) {
            return val;
        }
        else {
            return config.all;
        }
    }
    else {
        filters = traverseFilters(val, levels, levelIdx + 1);
        if (!filters) {
            filters = traverseFilters(config.all, levels, levelIdx + 1);
        }
        return filters;
    }
}
function traverseFilters ( config , levels , levelIdx ) { var lastIdx = levels . length - 1 ; var val , filters ; if ( ! config || levelIdx > lastIdx ) { return null ; } val = config [ levels [ levelIdx ] ] ; if ( levelIdx === lastIdx ) { if ( val ) { return val ; } else { return config . all ; } } else { filters = traverseFilters ( val , levels , levelIdx + 1 ) ; if ( ! filters ) { filters = traverseFilters ( config . all , levels , levelIdx + 1 ) ; } return filters ; } }
Recurse through the filter config to get the right filter values
@param config
@param levels
@param levelIdx
@returns {*}
Recurse through the filter config to get the right filter values