mirror of
https://github.com/penpot/penpot.git
synced 2025-05-23 01:36:11 +02:00
✨ Add obj/array? helper
This commit is contained in:
parent
b1e54a9714
commit
e6f8022de0
2 changed files with 6 additions and 2 deletions
|
@ -42,7 +42,7 @@
|
||||||
|
|
||||||
(defn propagate-wrapper-styles
|
(defn propagate-wrapper-styles
|
||||||
([children wrapper-props]
|
([children wrapper-props]
|
||||||
(if (.isArray js/Array children)
|
(if ^boolean (obj/array? children)
|
||||||
(->> children (map #(propagate-wrapper-styles-child % wrapper-props)))
|
(->> children (map #(propagate-wrapper-styles-child % wrapper-props)))
|
||||||
(-> children (propagate-wrapper-styles-child wrapper-props)))))
|
(-> children (propagate-wrapper-styles-child wrapper-props)))))
|
||||||
|
|
||||||
|
|
|
@ -6,11 +6,15 @@
|
||||||
|
|
||||||
(ns app.util.object
|
(ns app.util.object
|
||||||
"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?])
|
(:refer-clojure :exclude [set! new get get-in merge clone contains? array?])
|
||||||
(:require
|
(:require
|
||||||
["lodash/omit" :as omit]
|
["lodash/omit" :as omit]
|
||||||
[cuerdas.core :as str]))
|
[cuerdas.core :as str]))
|
||||||
|
|
||||||
|
(defn array?
|
||||||
|
[o]
|
||||||
|
(.isArray js/Array o))
|
||||||
|
|
||||||
(defn create [] #js {})
|
(defn create [] #js {})
|
||||||
|
|
||||||
(defn get
|
(defn get
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue