source/node/tools/searching-instance.js
function findEntriesByCheck(groups, compareFn) {
    var foundEntries = [],
        newEntries;
    groups.forEach(function(group) {
        newEntries = group.getEntries().filter(compareFn);
        if (newEntries.length > 0) {
            foundEntries = foundEntries.concat(newEntries);
        }
        newEntries = findEntriesByCheck(group.getGroups(), compareFn);
        if (newEntries.length > 0) {
            foundEntries = foundEntries.concat(newEntries);
        }
    });
    return foundEntries;
}
function findEntriesByCheck(groups, compareFn) {
    var foundEntries = [],
        newEntries;
    groups.forEach(function(group) {
        newEntries = group.getEntries().filter(compareFn);
        if (newEntries.length > 0) {
            foundEntries = foundEntries.concat(newEntries);
        }
        newEntries = findEntriesByCheck(group.getGroups(), compareFn);
        if (newEntries.length > 0) {
            foundEntries = foundEntries.concat(newEntries);
        }
    });
    return foundEntries;
}
function findEntriesByCheck ( groups , compareFn ) { var foundEntries = [ ] , newEntries ; groups . forEach ( function ( group ) { newEntries = group . getEntries ( ) . filter ( compareFn ) ; if ( newEntries . length > 0 ) { foundEntries = foundEntries . concat ( newEntries ) ; } newEntries = findEntriesByCheck ( group . getGroups ( ) , compareFn ) ; if ( newEntries . length > 0 ) { foundEntries = foundEntries . concat ( newEntries ) ; } } ) ; return foundEntries ; }
Find entry instances by filtering with a compare function
@param {Array.<Group>} groups The groups to check in
@param {Function} compareFn The callback comparison function, return true to keep and false
to strip
@returns {Array.<Entry>} An array of found entries
Find entry instances by filtering with a compare function