src/http/get-index/ssr.js
/**
 * Search and array of nodes and its children for nodes passing a test function.
 *
 * Same as `find`, only with less options, leading to reduced complexity.
 *
 * @param test Function to test nodes on.
 * @param nodes Array of nodes to search.
 * @returns All nodes passing `test`.
 */
Search and array of nodes and its children for nodes passing a test function.
Same as `find`, only with less options, leading to reduced complexity.

@param test Function to test nodes on.
@param nodes Array of nodes to search.
@returns All nodes passing `test`.
Search and array of nodes and its children for nodes passing a test function . Same as ` find ` only with less options leading to reduced complexity . @param test Function to test nodes on . @param nodes Array of nodes to search . @returns All nodes passing ` test ` .
function findAll$1(test, nodes) {
  var _a;
  var result = [];
  var stack = nodes.filter(domhandler_1$3.isTag);
  var elem;
  while (elem = stack.shift()) {
    var children = (_a = elem.children) === null || _a === void 0 ? void 0 : _a.filter(domhandler_1$3.isTag);
    if (children && children.length > 0) {
      stack.unshift.apply(stack, children);
    }
    if (test(elem))
    result.push(elem);
  }
  return result;
}
function findAll$1 ( test , nodes ) { var _a ; var result = [ ] ; var stack = nodes . filter ( domhandler_1$3 . isTag ) ; var elem ; while ( elem = stack . shift ( ) ) { var children = ( _a = elem . children ) === null || _a === void 0 ? void 0 : _a . filter ( domhandler_1$3 . isTag ) ; if ( children && children . length > 0 ) { stack . unshift . apply ( stack , children ) ; } if ( test ( elem ) ) result . push ( elem ) ; } return result ; }
Search and array of nodes and its children for nodes passing a test function.
Search and array of nodes and its children for nodes passing a test function .