mirror of
https://github.com/penpot/penpot.git
synced 2025-03-11 07:11:32 -05:00
✨ Add arity-1 to d/nilv that returns a transducer
This commit is contained in:
parent
d1e74b0da9
commit
ef27301238
1 changed files with 4 additions and 2 deletions
|
@ -580,8 +580,10 @@
|
||||||
|
|
||||||
(defn nilv
|
(defn nilv
|
||||||
"Returns a default value if the given value is nil"
|
"Returns a default value if the given value is nil"
|
||||||
[v default]
|
([default]
|
||||||
(if (some? v) v default))
|
(map #(nilv % default)))
|
||||||
|
([v default]
|
||||||
|
(if (some? v) v default)))
|
||||||
|
|
||||||
(defn num?
|
(defn num?
|
||||||
"Checks if a value `val` is a number but not an Infinite or NaN"
|
"Checks if a value `val` is a number but not an Infinite or NaN"
|
||||||
|
|
Loading…
Add table
Reference in a new issue