overleaf/services/web/frontend/js/utils/operations.ts
Alf Eaton 7b3ffb9fae Standardise types for ranges (#16927)
GitOrigin-RevId: 28dd0eb67e1684e6bd0e452d15315ce1f9e3481a
2024-02-09 09:06:51 +00:00

13 lines
375 B
TypeScript

import {
CommentOperation,
DeleteOperation,
InsertOperation,
Operation,
} from '../../../types/change'
export const isInsertOperation = (op: Operation): op is InsertOperation =>
'i' in op
export const isCommentOperation = (op: Operation): op is CommentOperation =>
'c' in op
export const isDeleteOperation = (op: Operation): op is DeleteOperation =>
'd' in op