Skip to main content

Module apply

Module apply 

Source
Expand description

Apply a parsed list of Edits to a text body and return the post-edit text plus diagnostic warnings.

Replacement groups are first normalized by boundary repair, which absorbs common model mistakes where a payload restates unchanged range boundaries or duplicates/drops structural closers. After-insert landings are then corrected when a body’s indentation claims a depth different from its anchor’s.

Ported from omp packages/hashline/src/apply.ts.

Functions§

apply_edits
Apply a parsed list of Edits to text. Pure function — no I/O.