mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-15 02:20:58 -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
|