chore: add todo comment for prepend append

This commit is contained in:
三咲智子 Kevin Deng 2023-11-27 06:34:37 +08:00
parent 71cf732d6d
commit f9c607dbe4
No known key found for this signature in database
GPG Key ID: 69992F2250DFD93E
1 changed files with 2 additions and 0 deletions

View File

@ -60,6 +60,7 @@ export function insert(
export function prepend(parent: ParentBlock, ...nodes: Node[]) {
if (parent instanceof Node) {
// TODO use insertBefore for better performance https://jsbench.me/rolpg250hh/1
parent.prepend(...nodes)
} else if (isArray(parent)) {
parent.unshift(...nodes)
@ -68,6 +69,7 @@ export function prepend(parent: ParentBlock, ...nodes: Node[]) {
export function append(parent: ParentBlock, ...nodes: Node[]) {
if (parent instanceof Node) {
// TODO use insertBefore for better performance
parent.append(...nodes)
} else if (isArray(parent)) {
parent.push(...nodes)