v8.0.0
Big clean up release
-
Added
S.assertOrRaiseWithorschema.assertfor JS/TS users. It doesn't return parsed value, which makes the operation 2-3 times faster for some schemas. -
Added
S.setGlobalConfig. Now it's possible to customize the global behavior of the library:- Change the default
unknownKeysstrategy for Object fromStriptoStrict - Disable NaN check for numbers
- Change the default
-
S.unionrefactoring- Drastically improved parsing performance (1x-1000x times faster depending on the case)
- Returned back async support
- More specific error messages
- When serializing to JSON or JSON string the
S.unionnow tries to serialize other items when encounters a non-jsonable schema. Before it used to fail the whole union.
-
Parse Async refactoring
- Performance improvements
- Made it more maintainable and less error-prone
- Hidden bug fixes
- Removed
S.parseAsyncInStepsWithandS.parseAnyAsyncInStepsWithto reduce internal library complexity. Create an issue if you need it.
-
S.recursiverefactoring- Performance improvements
- Made it more maintainable and less error-prone
- Fixed bug with serializing to JSON or JSON string
-
For JS/TS users
- Move operations from functions to
Schemamethods - Add
serializeToJsonOrThrow - Improve TS types and make them compatible with generated types from
genType
- Move operations from functions to
-
Other improvements
S.jsonStringdoesn't fail on getting non-jsonable schema anymore. It will fail on the first serialization run instead- Removed
InvalidLiteralerror in favor ofInvalidType - Changed default
nameofS.literalschema (Literal(<value>)-><value>) - Renamed
InvalidJsonStructerror toInvalidJsonSchema, since afterrescript-struct->rescript-schemait became misleading - Update
operationtype to be more detailed and feature it in the error message.
Full Changelog: v7.0.2...v8.0.0