Skip to content

Type Editor


Type Editor / @type-editor/changeset / simplify-changes/simplify-adjacent-changes / simplifyAdjacentChanges

Function: simplifyAdjacentChanges()

ts
function simplifyAdjacentChanges(changes, from, to, doc, target): void;

Defined in: simplify-changes/simplify-adjacent-changes.ts:25

Processes a group of adjacent changes and adds simplified versions to the target array.

This function examines changes in a group to determine if they should be merged. Changes are merged if they're within the same word (no word boundary between them). Mixed insertions/deletions are expanded to word boundaries unless they're single character replacements.

Parameters

ParameterTypeDescription
changesreadonly Change<any>[]The complete array of changes.
fromnumberThe start index in the changes array (inclusive).
tonumberThe end index in the changes array (exclusive).
docNode_2The document node to analyze.
targetChange<any>[]The array to add simplified changes to.

Returns

void