chore: remove AnyDuringMigration from events (#6382)

* chore: remove AnyDuringMigration from events

* chore: format

* chore: lint

* chore: fix tests

* fix: correct types for JSON properties

* chore: fix tests

* refactor: replace exclamation markers with errors

* chore: fix build and tests

* chore: set event types as members, rather than in constructor

* chore: update comment

* chore: export new types

* chore: format

* chore: remove unnecessary override

* chore: change how we're overriding isBlank

* chore: remove unnecessary ?

* chore: remove non-null assertion in block move event

* chore: format

* chore: revert changes to isNull

* chore: format
This commit is contained in:
Beka Westberg
2022-09-27 15:08:05 -07:00
committed by GitHub
parent eb1b78663c
commit f678531389
36 changed files with 787 additions and 455 deletions

View File

@@ -147,16 +147,16 @@ function extractObjectFromEvent(
switch (e.type) {
case eventUtils.BLOCK_CREATE:
case eventUtils.BLOCK_MOVE:
object = workspace.getBlockById((e as BlockCreate | BlockMove).blockId);
object = workspace.getBlockById((e as BlockCreate | BlockMove).blockId!);
if (object) {
object = object.getRootBlock();
}
break;
case eventUtils.COMMENT_CREATE:
case eventUtils.COMMENT_MOVE:
object = workspace.getCommentById(
(e as CommentCreate | CommentMove).commentId) as
WorkspaceCommentSvg |
object =
workspace.getCommentById((e as CommentCreate | CommentMove).commentId!
) as WorkspaceCommentSvg |
null;
break;
}