Вход Регистрация
Файл: error-kitty/node_modules/cheerio/node_modules/CSSselect/node_modules/domutils/lib/helpers.js
Строк: 47
<?php
// removeSubsets
// Given an array of nodes, remove any member that is contained by another.
exports.removeSubsets = function(nodes) {
    var 
idx nodes.lengthnodeancestorreplace;

    
// Check if each node (or one of its ancestors) is already contained in the
    // array.
    
while (--idx > -1) {
        
node ancestor nodes[idx];

        
// Temporarily remove the node under consideration
        
nodes[idx] = null;
        
replace true;

        while (
ancestor) {
            if (
nodes.indexOf(ancestor) > -1) {
                
replace false;
                
nodes.splice(idx1);
                break;
            }
            
ancestor ancestor.parent;
        }

        
// If the node has been found to be unique, re-insert it.
        
if (replace) {
            
nodes[idx] = node;
        }
    }

    return 
nodes;
};
?>
Онлайн: 1
Реклама