operations.ts 375 B

12345678910111213
  1. import {
  2. CommentOperation,
  3. DeleteOperation,
  4. InsertOperation,
  5. Operation,
  6. } from '../../../types/change'
  7. export const isInsertOperation = (op: Operation): op is InsertOperation =>
  8. 'i' in op
  9. export const isCommentOperation = (op: Operation): op is CommentOperation =>
  10. 'c' in op
  11. export const isDeleteOperation = (op: Operation): op is DeleteOperation =>
  12. 'd' in op