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

x/html_parser/src/utils/helpers.ts>uniqueSort

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

Sort an array of nodes based on their relative position in the document and remove any duplicate nodes. If the array contains nodes that do not belong to the same document, sort order is unspecified.

Parameters

nodes: T[]

Array of DOM nodes.

Returns

T[]

Collection of unique nodes, sorted in document order.