MCPcopy Index your code
hub / github.com/stemkoski/stemkoski.github.com / direct_sibling

Function direct_sibling

MathBox/mathbox-bundle.js:47004–47022  ·  view source on GitHub ↗
(node, next, subj)

Source from the content-addressed store, hash-verified

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)

Callers

nothing calls this directly

Calls 1

nextFunction · 0.85

Tested by

no test coverage detected