Skip to content

Commit

Permalink
refactor: add Nullable type
Browse files Browse the repository at this point in the history
  • Loading branch information
Jocs committed Nov 12, 2023
1 parent 4016d69 commit d14e10d
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/block/base/treeNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ interface IConstructor<T> {
}

abstract class TreeNode extends LinkedNode<TreeNode> {
public parent: Parent | null = null;
public domNode: HTMLElement | null = null;
public parent: Nullable<Parent> = null;
public domNode: Nullable<HTMLElement> = null;
public tagName: string = "";
public classList: string[] = [];
public attributes: Attributes = {};
Expand Down Expand Up @@ -241,7 +241,6 @@ abstract class TreeNode extends LinkedNode<TreeNode> {
this.parent.children.remove(this);
this.parent = null;
this.domNode?.remove();
this.domNode = null;

return this;
}
Expand Down

0 comments on commit d14e10d

Please sign in to comment.