Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/html_parser/src/mod.ts>DomUtils.filter

Port of fb55/htmlparser2 for Deno
Latest
function DomUtils.filter
Re-export
import { DomUtils } from "https://deno.land/x/html_parser@v0.1.3/src/mod.ts";
const { filter } = DomUtils;

Search a node and its children for nodes passing a test function.

Parameters

test: (elem: Node) => boolean

Function to test nodes on.

node: Node | Node[]

Node to search. Will be included in the result set if it matches.

optional
recurse = [UNSUPPORTED]

Also consider child nodes.

optional
limit = [UNSUPPORTED]

Maximum number of nodes to return.

Returns

All nodes passing test.