-
Redesigned
Literal
module to make it more effecient- The
Literal.t
type was renamed toliteral
, became private and changed structure. UseS.Literal.parse
to create instances of the type. Literal.classify
->Literal.parse
Literal.toText
->Literal.toString
. Also, started using.toString
forFunction
literalls and removed spaces forDict
andArray
literals to make them look the same as theJSON.stringify
output.
- The
-
Updated ctx type names to
s
for better autoCompleteeffectCtx
->s
Object.ctx
->Object.s
Tuple.ctx
->Tuple.s
schemaCtx
->Schema.s
catchCtx
->Catch.s
-
Added
serializeToJsonStringOrRaiseWith
-
Allow to create
S.union
with single item -
PPX: Removed
@schema
for type expressions. Use@s.matches
instead. -
Added unsafe mode for
S.json
:S.json
->S.json(~validate: bool)
- More flexible
- Improved tree-shaking
- Can get the info from the
tagged
type:JSON
->JSON({validated: bool})
-
Removed
s.failWithError
. UseS.Error.raise
instead -
Removed async support for
S.union
. Please create an issue if you used the feature -
Improved parsing performance of S.array and S.dict ~3 times
-
Automatic serializing stopped working for tuples/objects/unions of literals. Use
S.literal
instead. -
Removed
InvalidTupleSize
error code in favor ofInvalidType
-
Changed payload of
Object
andTuple
variants in thetagged
type -
Don't recreate object on serialize when it's not transformed (TODO: Measure performance improvement for array of objects)
-
Moved built-in refinements from nested modules to improve tree-shaking:
-
Int.min
->intMin
-
Int.max
->intMax
-
Int.port
->port
-
Float.min
->floatMin
-
Float.max
->floatMax
-
Array.min
->arrayMin
-
Array.max
->arrayMax
-
Array.length
->arrayLength
-
String.min
->stringMin
-
String.max
->stringMax
-
String.length
->stringLength
-
String.email
->email
-
String.uuid
->uuid
-
String.cuid
->cuid
-
String.url
->url
-
String.pattern
->pattern
-
String.datetime
->datetime
-
String.trim
->trim
-