5.0.15 (2022-08-08)
- dependencies 2022-07-31 (#743) (72b945b), closes #744 #745 #746 #747 #752 #753 #748 #749 #750 #751 #755
- dependencies 2022-08-07 (#756) (02b94bf), closes #757 #758 #759 #763 #764 #765 #762 #761
5.0.14 (2022-07-26)
- dependencies 2022-07-28 (#728) (3b3045d)
- dependencies 2022-07-29 (#735) (c03fc2d)
- update node (#734) (1a8de05)
5.0.13 (2022-01-17)
- upgrade dependencies (4c3f2a8)
5.0.12 (2021-09-02)
- deps: upgrade everything (4c40c72)
- add semantic-release (7a022f6)
- oneOf param in doc (#552) (2de610a)
- ci: use github actions (#582) (05c604e)
5.0.2 (2020-01-31)
Object.anyOf()
Force one or many keys to be present
5.0.0 (2019-08-01)
New online documentation: https://bodinsamuel.github.io/altheia/
- Rewrite in Typescript
- NodeJs support: 8 >=
- Syntax ES6+
- Now use yarn
Object().schema()
old syntax no longer accepted. Please useschema(schema, { returnErrors = true })
- All tests should now return
{ valid: boolean; error: string } | boolean
alt.option()
unknown is nowtrue
by default- Types
.validate(<value>)
now return{ type, valid, result? }
- name has been renamed type
- isValid has been renamed valid Please refer to typescript definition to see full object
alt.validate()
can now take a body directlyalt.validate({ my: 'body' })
; old syntaxalt.body({ my: 'body' }).validate()
still work.
4.0.0 (2018-11-20)
- Alt(...).validate() can not be called twice, you need to
clone()
documentation
3.3.0 (2018-11-19)
- Object.schema(): now
returnErrors=true
by default
3.2.0 (2018-11-19)
- Object.in(): signature change (retro-compatible) with new option
oneErrorPerKey
documentation
3.1.1 (2018-11-06)
- Update dependencies
3.1.0 (2018-10-03)
- Array.oneOf(): documentation
- Update dependencies
- Add comments everywhere and enforce jsdoc with eslint
- All tests can now return an array of errors { isValid, error, errors }. This allow returning nested error.
3.0.0 (2018-08-01)
- New plugin: Function
- New plugin: Any
- Object.oneOf(): documentation
- Object.allOf(): documentation
Object.schema({ schema, returnErrors })
signature is nowObject.schema(schema, { returnErrors })
(old syntax is still accepted)
- All tests (and .custom()) must return either a boolean or a valid object { isValid, error }.
This allow returning custom error and argument to change the error message and be more strict about what is a succesful test.
If your
custom()
call is returning something else (string, number ...) an error will be thrown.
2.1.0 (2018-06-15)
- New plugin: Boolean