From 271256f794c88bc54928fc0b682b9dcc6e6ade7e Mon Sep 17 00:00:00 2001 From: Abhishiv Saxena Date: Thu, 17 Oct 2024 09:09:17 +0530 Subject: [PATCH] rf --- package.json | 2 +- src/dom/utils.ts | 2 +- src/utils/crawl.ts | 4 +--- 3 files changed, 3 insertions(+), 5 deletions(-) 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.