From ab34b5dbb627d597340a0029f0b3ccc45c10b4bd Mon Sep 17 00:00:00 2001 From: paku Date: Sun, 26 May 2024 13:57:51 +0900 Subject: [PATCH] Add merge-children-into-props function --- src/element.lisp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/element.lisp b/src/element.lisp index 965eb17..1110b56 100644 --- a/src/element.lisp +++ b/src/element.lisp @@ -32,9 +32,8 @@ (props element-props) (children element-children)) elm (if (functionp type) - (apply type (append props - (and children - (list :children children)))) + (apply type + (merge-children-into-props props children)) elm))) (defun flatten (x) @@ -45,3 +44,8 @@ (car x) (rec (cdr x) acc)))))) (rec x nil))) + +(defun merge-children-into-props (props children) + (append props + (and children + (list :children children))))