c4k-common/src/main/cljs/dda/c4k_keycloak/yaml.cljs

16 lines
398 B
Text
Raw Normal View History

2021-06-18 13:49:43 +00:00
(ns dda.c4k-keycloak.yaml
(:require
["js-yaml" :as yaml]
[shadow.resource :as rc]))
(defn load-resource [resource-name]
(case resource-name
"ingress_test.yaml" (rc/inline "ingress_test.yaml")
(throw (js/Error. "Undefined Resource!"))))
(defn from-string [input]
(js->clj (yaml/load input)
:keywordize-keys true))
(defn to-string [edn]
(yaml/dump (clj->js edn)))