Type Editor / @type-editor/model / diff/find-diff-start
diff/find-diff-start
Functions
| Function | Description |
|---|---|
Find the first position at which two fragments differ. This function performs a deep comparison of two fragments, starting from the beginning and moving forward until it finds the first difference. It compares nodes recursively, checking:
The comparison is optimized to skip identical subtrees by checking reference equality first. For text nodes, it performs character-by-character comparison to find the exact position where the text diverges. Example typescript |