mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-04 23:36:00 -05:00
16 lines
393 B
TypeScript
16 lines
393 B
TypeScript
|
import {
|
||
|
Change,
|
||
|
DeleteOperation,
|
||
|
InsertOperation,
|
||
|
} from '../../../../../types/change'
|
||
|
|
||
|
export const canAggregate = (
|
||
|
deletion: Change<DeleteOperation>,
|
||
|
insertion: Change<InsertOperation>
|
||
|
) =>
|
||
|
deletion.metadata?.user_id &&
|
||
|
// same user
|
||
|
deletion.metadata?.user_id === insertion.metadata?.user_id &&
|
||
|
// same position
|
||
|
deletion.op.p === insertion.op.p + insertion.op.i.length
|