mekanika / skematic

Data model & rule engine for JS objects
9 stars 0 forks source link

Validate should fail if passing a locked field in strict mode #37

Open cayuu opened 6 years ago

cayuu commented 6 years ago

Currently the following seems to pass validation:

const model = {name: {lock: true}}
Skematic.validate(model, {name: 'Jo'})
// -> { valid: true, errors: null }

That's okay, but there's no way to force a fail. Setting {strict: true} should probably fail it.