From ef273012389d0c7327876bbb16a3da3e07cece30 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Mon, 15 May 2023 09:20:32 +0200 Subject: [PATCH] :sparkles: Add arity-1 to d/nilv that returns a transducer --- common/src/app/common/data.cljc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/common/src/app/common/data.cljc b/common/src/app/common/data.cljc index f7316a274d..2a3320f6b1 100644 --- a/common/src/app/common/data.cljc +++ b/common/src/app/common/data.cljc @@ -580,8 +580,10 @@ (defn nilv "Returns a default value if the given value is nil" - [v default] - (if (some? v) v default)) + ([default] + (map #(nilv % default))) + ([v default] + (if (some? v) v default))) (defn num? "Checks if a value `val` is a number but not an Infinite or NaN"