silfverorg / duns.js

Javascript schema validator
5 stars 2 forks source link

Fixed bugg where none specified keys were allowed. #37

Closed silfverstrom closed 9 years ago

silfverstrom commented 9 years ago
var schema = Duns.object().keys({
  test : Duns.any(),
});

// This was previously allowed
schema.init({ test: 100, test2: 200}).validate();

I've changed the code above to return false on validate.

Also in this commit, some additional tests and some stabilisations when getting default arguments in validators. should reduce problems to come.