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

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

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

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.