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

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

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

Finds the first element inside of an array that matches a test function.

Parameters

test: (elem: Node) => boolean

Function to test nodes on.

nodes: Node[]

Array of nodes to search.

Returns

Node | undefined

The first node in the array that passes test.