function / @typed/template/Wire

getAllSiblingsBetween

Gets all sibling nodes between exact range boundaries, excluding both markers.

Package version
1.0.0-beta.7
Category
Range traversal
Since
1.0.0
Stability
internal-but-published

Import

import { getAllSiblingsBetween } from "@typed/template/Wire";

Signatures

export declare function getAllSiblingsBetween(start: Node, end: Node): Array<Node>;

Why

Renderer extensions need a transparent view of a Wire or hydration range without introducing a wrapper node.

Ownership and lifetime

The returned array borrows the existing nodes; it does not detach or retain their parent.

Examples

import { getAllSiblingsBetween } from "@typed/template/Wire"

const parent = document.createElement("div")
const startComment = document.createComment("start")
const child = document.createElement("span")
const endComment = document.createComment("end")
parent.append(startComment, child, endComment)

const nodes = getAllSiblingsBetween(startComment, endComment)
console.log(nodes[0] === child) // true

Other public imports

These import paths expose the same declaration. Each page retains its own public name and signature.

Source