mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-29 19:43:44 -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
|