Releases: DWTechs/Antity.js
Releases · DWTechs/Antity.js
Better property names
- Rename
sendproperty toisPrivatewith inverted logic (isPrivate: true means the property should NOT be sent) - Rename
needproperty torequiredForfor better clarity - Rename
typeCheckproperty toisTypeCheckedfor consistency - Rename
unsafePropsgetter toprivatePropsto align with new naming convention
Entity properties update
- Delete
check()method - Delete
methods,sanityze,normalizeandvalidateoptions requiredoption is now calledrequire. It is of type array of methods instead of booleansafeoption is now calledsend
Replace `normalize()` and `validate()`
- Replace
normalize()andvalidate()methods with more explicit methods:- Add
normalizeArray()for normalizing arrays of records (supportsreq.body.rowsas array) - Add
validateArray()for validating arrays of records (supportsreq.body.rowsas array) - Add
normalizeOne()for normalizing a single record (supportsreq.bodyas object) - Add
validateOne()for validating a single record (supportsreq.bodyas object)
- Add
Arbitrary custom properties
Propertyclass now includes an index signature, allowing arbitrary custom properties to be added to instances. This makes the class extensible for downstream libraries and user code.
Improve error messages
- Improve error messages
- Update dependencyies :
- @dwtechs/checkard to 3.5.1
- @dwtechs/sparray to 0.2.1
logs
Check() method
- Add
checkmiddleware to Entity class for validating and normalizing request body rows
Password validation
- Add password validation with configurable options
Typescript v5.8.3
- Update Typescript to version 5.8.3
Fix middleware scope
- Fix scope issue when using validate and normalize middlewares