Created
March 3, 2022 22:13
-
-
Save kennyjwilli/b46a244aaba4c9248dfe733413fd2e40 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn ->eql | |
[?schema] | |
(let [f (fn convert [paths] | |
(let [k->joins (reduce (fn [acc [k & joins]] | |
(update acc k (fnil #(cond-> % joins (conj joins)) []))) | |
{} paths)] | |
(into [] | |
(map (fn [[k joins]] | |
(if (seq joins) {k (convert joins)} k))) | |
k->joins)))] | |
(f (keep (fn [{:keys [in]}] | |
(when (seq in) (remove #{::m/in} in))) (mu/subschemas ?schema))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment