node_modules/gulp-uncss/node_modules/uncss/lib/lib.js
/**
 * Private function used in filterUnusedRules.
 * @param  {Array} pages          List of PhantomJS pages
 * @param  {Array} selectors      CSS selectors created by the CSS parser
 * @param  {Array} ignore         List of selectors to be ignored
 * @param  {Array} used_selectors List of Selectors found in {pages}
 * @return {Array}                The selectors matched in the DOMs
 */
Private function used in filterUnusedRules.
Private function used in filterUnusedRules .
function filterUnusedSelectors(pages, selectors, ignore, used_selectors) {
    var i = 0;
    return selectors.filter(function (selector) {
        selector = dePseudify(selector);
        if (selector[0] === '@') {
            return true;
        }
        for (i = 0; i < ignore.length; ++i) {
            if (_.isRegExp(ignore[i]) && ignore[i].test(selector)) {
                return true;
            }
            if (ignore[i] === selector) {
                return true;
            }
        }
        return used_selectors.indexOf(selector) !== -1;
    });
}
function filterUnusedSelectors ( pages , selectors , ignore , used_selectors ) { var i = 0 ; return selectors . filter ( function ( selector ) { selector = dePseudify ( selector ) ; if ( selector [ 0 ] === '@' ) { return true ; } for ( i = 0 ; i < ignore . length ; ++ i ) { if ( _ . isRegExp ( ignore [ i ] ) && ignore [ i ] . test ( selector ) ) { return true ; } if ( ignore [ i ] === selector ) { return true ; } } return used_selectors . indexOf ( selector ) !== - 1 ; } ) ; }
Private function used in filterUnusedRules.
Private function used in filterUnusedRules .
/* There are some selectors not supported for matching, like
     *   :before, :after
     * They should be removed only if the parent is not found.
     * Example: '.clearfix:before' should be removed only if there
     *          is no '.clearfix'
     */ /* TODO: process @-rules */ /* If ignore is RegExp and matches selector ... */