Skip to content

@jsvision/code-editor / documentOffset

Function: documentOffset()

documentOffset(value, maximum?): DocumentOffset

Defined in: code-editor/src/document/types.ts:207

Creates a trusted document offset after validating its numeric domain and optional bound.

Parameters

value

number

maximum?

number = Number.MAX_SAFE_INTEGER

Returns

DocumentOffset

Example

ts
const start = documentOffset(0, snapshot.length);