diff --git a/lib/hyperscript/runtime.sx b/lib/hyperscript/runtime.sx index b913f913..5739bc08 100644 --- a/lib/hyperscript/runtime.sx +++ b/lib/hyperscript/runtime.sx @@ -355,6 +355,21 @@ (list) value) value)) + ((= type-name "Set") + (if + (list? value) + (reduce + (fn + (acc x) + (if (some (fn (a) (= a x)) acc) acc (append acc (list x)))) + (list) + value) + value)) + ((= type-name "Map") + (if + (dict? value) + (map (fn (k) (list k (get value k))) (keys value)) + value)) (true value)))) (define diff --git a/shared/static/wasm/sx/hs-runtime.sx b/shared/static/wasm/sx/hs-runtime.sx index b913f913..5739bc08 100644 --- a/shared/static/wasm/sx/hs-runtime.sx +++ b/shared/static/wasm/sx/hs-runtime.sx @@ -355,6 +355,21 @@ (list) value) value)) + ((= type-name "Set") + (if + (list? value) + (reduce + (fn + (acc x) + (if (some (fn (a) (= a x)) acc) acc (append acc (list x)))) + (list) + value) + value)) + ((= type-name "Map") + (if + (dict? value) + (map (fn (k) (list k (get value k))) (keys value)) + value)) (true value)))) (define