peak-ai / jedlik

DynamoDB ODM for Node
MIT License
106 stars 4 forks source link

Validation #6

Closed harrim91 closed 4 years ago

harrim91 commented 4 years ago

Added a validation option to the model initialisation that gets run on save. It's designed to work with Joi, because it's way easier than writing our own logic (which I started doing and then gave up).

If validation fails, the error gets thrown. If the validation passes, then default values get applied and these are included in the save.