mirror of
https://github.com/overleaf/overleaf.git
synced 2024-10-24 21:12:38 -04: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
|