refactor: tidy

This commit is contained in:
三咲智子 Kevin Deng 2023-11-23 23:43:19 +08:00
parent 1d2f66e111
commit cd768d262f
No known key found for this signature in database
GPG Key ID: 69992F2250DFD93E
2 changed files with 7 additions and 7 deletions

View File

@ -1,8 +1,3 @@
export { template } from './template'
export * from './render'
export * from './on'
type Children = Record<number, [ChildNode, Children]>
export function children(n: ChildNode): Children {
return { ...Array.from(n.childNodes).map(n => [n, children(n)]) }
}
export * from './render'
export * from './template'

View File

@ -112,3 +112,8 @@ export function setDynamicProp(el: Element, key: string, val: any) {
setAttr(el, key, void 0, val)
}
}
type Children = Record<number, [ChildNode, Children]>
export function children(n: ChildNode): Children {
return { ...Array.from(n.childNodes).map(n => [n, children(n)]) }
}