0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-03-10 14:51:37 -05:00

🐛 Fix incorrect pred composition on number schema types

Fixes the following:

  => (sm/validate (sm/schema [::sm/int {:max 10}]) nil)
  Cannot invoke "Object.getClass()" because "x" is null
This commit is contained in:
Andrey Antukh 2024-10-28 13:51:40 +01:00
parent ba3f84fd6c
commit 75011ca0ff

View file

@ -694,8 +694,8 @@
pred)
pred (if (some? max)
(fn [v]
(and (>= max v)
(pred v)))
(and (pred v)
(>= max v)))
pred)]
{:pred pred
@ -732,8 +732,8 @@
pred)
pred (if (some? max)
(fn [v]
(and (>= max v)
(pred v)))
(and (pred v)
(>= max v)))
pred)]
{:pred pred
@ -762,8 +762,8 @@
pred)
pred (if (some? max)
(fn [v]
(and (>= max v)
(pred v)))
(and (pred v)
(>= max v)))
pred)
gen (sg/one-of