From 6f454709fd240913faa5eef9a56b6ef740547f77 Mon Sep 17 00:00:00 2001 From: Tommi Reiman Date: Sun, 24 Sep 2023 18:46:38 +0300 Subject: [PATCH 1/2] update pom --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 67ee120fd..a6230c559 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 metosin malli - 0.12.0 + 0.13.0 malli @@ -15,7 +15,7 @@ https://github.com/metosin/malli scm:git:git://github.com/metosin/malli.git scm:git:ssh://git@github.com/metosin/malli.git - 0.12.0 + 0.13.0 From b78b052a42f97dc5120fd2c4ea54c9adcdf7f184 Mon Sep 17 00:00:00 2001 From: Leandro Doctors Date: Mon, 11 Mar 2024 15:36:52 +0000 Subject: [PATCH 2/2] Improve core.cljc --- src/malli/core.cljc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/malli/core.cljc b/src/malli/core.cljc index 8808e22f2..5befe7bda 100644 --- a/src/malli/core.cljc +++ b/src/malli/core.cljc @@ -2553,7 +2553,7 @@ | key | description | | ----------|-------------| | `:schema` | function schema - | `:scope` | optional set of scope definitions, defaults to `#{:input :output}` + | `:scope` | optional set of scope definitions, defaults to `#{:input :output :fn}` | `:report` | optional side-effecting function of `key data -> any` to report problems, defaults to `m/-fail!` | `:gen` | optional function of `schema -> schema -> value` to be invoked on the args to get the return value" ([props] @@ -2563,9 +2563,9 @@ ([{:keys [scope report gen] :or {scope #{:input :output}, report -fail!} :as props} f options] (let [schema (-> props :schema (schema options))] (case (type schema) - :=> (let [{:keys [min max input output]} (-function-info schema) - [validate-input validate-output] (-vmap validator [input output]) - [wrap-input wrap-output] (-vmap (partial contains? scope) [:input :output]) + :=> (let [{:keys [min max input output fn]} (-function-info schema) + [validate-input validate-output validate-fn] (-vmap validator [input output fn]) + [wrap-input wrap-output wrap-fn] (-vmap (partial contains? scope) [:input :output :fn]) f (or (if gen (gen schema) f) (-fail! ::missing-function {:props props}))] (fn [& args] (let [args (vec args), arity (count args)]