bradwestfall / house-rules

Highly re-usable field/input validators
MIT License
10 stars 1 forks source link

Creating new schema with `undefined` rule should fail #1

Open iamvanja opened 7 years ago

iamvanja commented 7 years ago

Consider this scenario:

const schema = new Schema({ email: undefined })

This should IMHO fail or at least spit out a warning.

Now validating values against this schema returns an empyy object as if validation is passed.

// output: {}
schema.validate({ email: 'aaaa' })

If creating new schema did not fail, this should certainly fail.

I don't mind working on this if there is interest and agreement how this should be handled.