0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-02-10 09:08:31 -05:00

🔥 Remove inneficient obj/without helper

This commit is contained in:
Andrey Antukh 2023-09-12 16:30:15 +02:00
parent 393863b29f
commit 307cfa287f
2 changed files with 3 additions and 11 deletions

View file

@ -87,7 +87,9 @@
wrapper-props
(-> (obj/clone props)
(obj/without ["shape" "children" "disable-shadows?"])
(obj/unset! "shape")
(obj/unset! "children")
(obj/unset! "disable-shadows?")
(obj/set! "ref" ref)
(obj/set! "id" (dm/fmt "shape-%" shape-id))
(obj/set! "style" styles))

View file

@ -8,7 +8,6 @@
"A collection of helpers for work with javascript objects."
(:refer-clojure :exclude [set! new get get-in merge clone contains? array?])
(:require
["lodash/omit" :as omit]
[cuerdas.core :as str]))
(defn array?
@ -48,15 +47,6 @@
(rest keys)
(unchecked-get res key))))))
#_:clj-kondo/ignore
(defn without
[obj keys]
(let [keys (cond
(vector? keys) (into-array keys)
(array? keys) keys
:else (throw (js/Error. "unexpected input")))]
(omit obj keys)))
(defn clone
[a]
(js/Object.assign #js {} a))