Skip to content

ChangeDesc.mapPos method

ChangeDesc › mapPos

Official

Map a given position through these changes.

Signature:

mapPos(pos: number, assoc?: number | undefined): number

Parameters:

ParameterTypeDescription
posnumberThe position to map.
assoc?number | undefinedWhich side the position is associated with.

Returns: numberThe mapped position.


Official

Map a given position through these changes with a specific mode.

Signature:

mapPos(pos: number, assoc: number, mode: MapMode): null | number

Parameters:

ParameterTypeDescription
posnumberThe position to map.
assocnumberWhich side the position is associated with.
modeMapModeThe mapping mode.

Returns: null | numberThe mapped position, or null if deleted.