refactor: remove InsertPosition

This commit is contained in:
三咲智子 Kevin Deng 2023-11-29 21:20:05 +08:00
parent 5df8f0e134
commit b3fdccec6f
No known key found for this signature in database
GPG Key ID: 69992F2250DFD93E
1 changed files with 1 additions and 12 deletions

View File

@ -30,22 +30,11 @@ export function normalizeContainer(container: string | ParentNode): ParentNode {
: container
}
export const enum InsertPosition {
FIRST,
LAST
}
export function insert(
block: Block,
parent: ParentNode,
anchor: Node | InsertPosition | null = null
anchor: Node | null = null
) {
anchor =
typeof anchor === 'number'
? anchor === InsertPosition.FIRST
? parent.firstChild
: null
: anchor
// if (!isHydrating) {
if (block instanceof Node) {
parent.insertBefore(block, anchor)