jshint.com complains about this line break – the && should at the end of the line.

Neatest might be:

if (constraint.hasOwnProperty(field) && 
  field !== 'advanced' && field !== 'required') {
    ...