| 47002 | } |
| 47003 | |
| 47004 | function direct_sibling(node, next, subj) { |
| 47005 | var parent = options.parent(node) |
| 47006 | , idx = 0 |
| 47007 | , children |
| 47008 | |
| 47009 | children = options.children(parent) |
| 47010 | |
| 47011 | for(var i = 0, len = children.length; i < len; ++i) { |
| 47012 | if(children[i] === node) { |
| 47013 | idx = i |
| 47014 | |
| 47015 | break |
| 47016 | } |
| 47017 | } |
| 47018 | |
| 47019 | return children[idx - 1] && next(children[idx - 1], subj) ? |
| 47020 | children[idx - 1] : |
| 47021 | null |
| 47022 | } |
| 47023 | |
| 47024 | function any_sibling(node, next, subj) { |
| 47025 | var parent = options.parent(node) |