mirror of
https://github.com/penpot/penpot.git
synced 2025-05-25 04:26:15 +02:00
🔥 Remove inneficient obj/without helper
This commit is contained in:
parent
393863b29f
commit
307cfa287f
2 changed files with 3 additions and 11 deletions
|
@ -87,7 +87,9 @@
|
||||||
|
|
||||||
wrapper-props
|
wrapper-props
|
||||||
(-> (obj/clone 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! "ref" ref)
|
||||||
(obj/set! "id" (dm/fmt "shape-%" shape-id))
|
(obj/set! "id" (dm/fmt "shape-%" shape-id))
|
||||||
(obj/set! "style" styles))
|
(obj/set! "style" styles))
|
||||||
|
|
|
@ -8,7 +8,6 @@
|
||||||
"A collection of helpers for work with javascript objects."
|
"A collection of helpers for work with javascript objects."
|
||||||
(:refer-clojure :exclude [set! new get get-in merge clone contains? array?])
|
(:refer-clojure :exclude [set! new get get-in merge clone contains? array?])
|
||||||
(:require
|
(:require
|
||||||
["lodash/omit" :as omit]
|
|
||||||
[cuerdas.core :as str]))
|
[cuerdas.core :as str]))
|
||||||
|
|
||||||
(defn array?
|
(defn array?
|
||||||
|
@ -48,15 +47,6 @@
|
||||||
(rest keys)
|
(rest keys)
|
||||||
(unchecked-get res key))))))
|
(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
|
(defn clone
|
||||||
[a]
|
[a]
|
||||||
(js/Object.assign #js {} a))
|
(js/Object.assign #js {} a))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue