Skip to content

Commit

Permalink
fix(schema): improve fix for #8111
Browse files Browse the repository at this point in the history
  • Loading branch information
vkarpov15 committed Sep 1, 2019
1 parent 50aeda0 commit dba0336
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/schematype.js
Original file line number Diff line number Diff line change
Expand Up @@ -1405,6 +1405,8 @@ SchemaType.prototype.checkRequired = function(val) {
SchemaType.prototype.clone = function() {
const options = Object.assign({}, this.options);
const schematype = new this.constructor(this.path, options, this.instance);
schematype.validators = this.validators.slice();
schematype.requiredValidator = this.requiredValidator;
return schematype;
};

Expand Down

0 comments on commit dba0336

Please sign in to comment.