diff --git a/package.json b/package.json index f078de1..08a44cc 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "alfama", - "version": "1.3.15", + "version": "1.3.16", "author": "Abhishiv Saxena", "license": "MIT", "description": "Fine-grained reactive library with no compiler, no magic, and no virtual DOM", diff --git a/src/dom/utils.ts b/src/dom/utils.ts index a7d3167..19a118d 100644 --- a/src/dom/utils.ts +++ b/src/dom/utils.ts @@ -21,7 +21,7 @@ export const getDescendants = (node: TreeStep): TreeStep[] => { }, { kids: (parent) => { - return Array.isArray(parent.k) ? parent.k : []; + return [...(Array.isArray(parent.k) ? parent.k : [])]; }, order: "post", } diff --git a/src/utils/crawl.ts b/src/utils/crawl.ts index cb31a3f..30771e4 100644 --- a/src/utils/crawl.ts +++ b/src/utils/crawl.ts @@ -4,9 +4,7 @@ export const crawl = ( iterate: (node: T) => void, options: { order: "post"; kids: (node: T) => T[] } ) => { - if (options.order === "post") { - dfsPostOrder(root, iterate, options.kids); - } + dfsPostOrder(root, iterate, options.kids); }; // Helper function for dfsPostOrder.