🐛 Convert in copies nested main instances when duplicating

This commit is contained in:
Andrés Moya 2023-11-10 17:24:01 +01:00
parent 69435e32d9
commit 5fb4703d95
2 changed files with 37 additions and 6 deletions

View file

@ -163,12 +163,17 @@
result))))
(defn get-parent-ids-seq
"Returns a vector of parents of the specified shape."
"Returns a sequence of parents of the specified shape."
[objects shape-id]
(let [parent-id (get-parent-id objects shape-id)]
(when (and (some? parent-id) (not= parent-id shape-id))
(lazy-seq (cons parent-id (get-parent-ids-seq objects parent-id))))))
(defn get-parent-ids-seq-with-self
"Returns a sequence of parents of the specified shape, including itself."
[objects shape-id]
(cons shape-id (get-parent-ids-seq objects shape-id)))
(defn get-parents
"Returns a vector of parents of the specified shape."
[objects shape-id]