summaryrefslogtreecommitdiff
path: root/includes/external/addressbook/node_modules/cheerio-select/lib/esm/helpers.js
blob: 1e5c8d51168b26108e5c8a36531fef00718840bd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import { isFilter } from "./positionals.js";
export function getDocumentRoot(node) {
    while (node.parent)
        node = node.parent;
    return node;
}
export function groupSelectors(selectors) {
    const filteredSelectors = [];
    const plainSelectors = [];
    for (const selector of selectors) {
        if (selector.some(isFilter)) {
            filteredSelectors.push(selector);
        }
        else {
            plainSelectors.push(selector);
        }
    }
    return [plainSelectors, filteredSelectors];
}
//# sourceMappingURL=helpers.js.map