Skip to Content

@revideo/2d


@revideo/2d / code / extractRange

Function: extractRange()

extractRange(range, fragments): [CodeTag[], number]

Defined in: 2d/src/lib/code/extractRange.ts:18 

Transform the fragments to isolate the given range into its own fragment.

Parameters

range

CodeRange

The range to extract.

fragments

CodeTag[]

The fragments to transform.

Returns

[CodeTag[], number]

A tuple containing the transformed fragments and the index of the isolated fragment within.

Remarks

This function will try to preserve the original fragments, resolving them only if they overlap with the range.

© 2026 Haven Technologies, Inc.
Function: extractRange() – Revideo