code: function extractRules(model, options) {
    // check if rules are passed manually
    if (options.rules) {
      return options.rules;
    }
  
    // check if Model class had rules defined statically
    if (
      !model ||
      !model.__proto__ ||
      !model.__proto__.constructor ||
      !model.__proto__.constructor.validationRules
    ) {
      return [];
    }
  
    const rules = model.__proto__.constructor.validationRules;
  
    // rules not defined properly
    if (!Array.isArray(rules)) {
      throw Error(`Validation rules not defined correctly in Model`);
    }
  
    return rules;
  }
docs: /* eslint-disable no-proto, func-names