Skip to content

rangeSetToArray<Value>

Lists the ranges of a RangeSet in document order, for assertions in tests and for debugging.

Import:

import { rangeSetToArray } from '@mnaoumov/obsidian-lib/codemirror/range-set';

Signature:

function rangeSetToArray(rangeSet: RangeSet<Value>, from: number): RangeSetEntry<Value>[]

Parameters:

Parameter Type Description
rangeSet RangeSet<Value> The range set to list, e.g. a DecorationSet.
from number The position to start listing from. Ranges ending before it are skipped. Defaults to 0.

Returns: RangeSetEntry<Value>[] — The ranges as plain { from, to, value } objects.