tmpfs / async-validate

Asynchronous type validation for node and the browser
Other
314 stars 45 forks source link

Implement match property #48

Closed tmpfs closed 8 years ago

tmpfs commented 8 years ago

Apply a rule to multiple fields of a source object using a regexp match on field name, this allow the use case such as:

{match:/^address[0-9]{1,1}$/}

When you have fields named address0, address1 etc. it becomes much easier to share the rule across the properties.

tmpfs commented 8 years ago

Considered implemented in db24584f4290442a1d1430acbeb9652a724faeee.

Expands the match rule to all fields that exist matching the regular expression and assigns a cloned rule (with the match property removed) for each matched property name.