export function getDescedantBy(node, f) {
    let result = null;
    node.descendants((node, pos, parent, index) => {
        if (result)
            return false;
        const child = { node, pos, parent, index };
        if (f(child)) {
            result = child;
            return false;
        }
        return true;
    });
    return result;
}
export function getDescedantByAttribute(node, attr, value) {
    const values = Array().concat(value);
    return getDescedantBy(node, (item) => values.includes(item.node.attrs[attr]));
}
//# sourceMappingURL=node-descedants.js.map
