mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-04 22:15:55 -05:00
c870bd5f53
History migration: Add "compare to" and "compare from" options GitOrigin-RevId: f550ad06b1e812011ecb32e6772354eb0abc2163
19 lines
493 B
TypeScript
19 lines
493 B
TypeScript
import { UpdateRange } from '../services/types/update'
|
|
|
|
export const updateRangeUnion = (
|
|
updateRange1: UpdateRange,
|
|
updateRange2: UpdateRange
|
|
) => {
|
|
return {
|
|
fromV: Math.min(updateRange1.fromV, updateRange2.fromV),
|
|
toV: Math.max(updateRange1.toV, updateRange2.toV),
|
|
fromVTimestamp: Math.min(
|
|
updateRange1.fromVTimestamp,
|
|
updateRange2.fromVTimestamp
|
|
),
|
|
toVTimestamp: Math.max(
|
|
updateRange1.toVTimestamp,
|
|
updateRange2.toVTimestamp
|
|
),
|
|
}
|
|
}
|