scripts/dom/index.js
function _getSibling(target, dir, filter, options) {
    let match;

    $each(target, (el) => {
        const index = $index(el) + dir;

        $children($parent(el)).forEach((el, i) => {
            if (i === index &&
                (! filter || filter && $is(el, filter, options))) {
                match = el;
            }
        });
    });

    return match;
}
function _getSibling(target, dir, filter, options) {
    let match;

    $each(target, (el) => {
        const index = $index(el) + dir;

        $children($parent(el)).forEach((el, i) => {
            if (i === index &&
                (! filter || filter && $is(el, filter, options))) {
                match = el;
            }
        });
    });

    return match;
}
function _getSibling ( target , dir , filter , options ) { let match ; $each ( target , ( el ) => { const index = $index ( el ) + dir ; $children ( $parent ( el ) ) . forEach ( ( el , i ) => { if ( i === index && ( ! filter || filter && $is ( el , filter , options ) ) ) { match = el ; } } ) ; } ) ; return match ; }
Return either direct previous or next sibling

@private
@param {($|HTMLElement|string)} target
@param {number} dir
@param filter
@param {Object} [options]
@returns {HTMLElement}
Return either direct previous or next sibling