This commit is contained in:
Jonasz Bigda
2023-03-25 21:51:42 +01:00
parent 0db1d5117e
commit b332e9ceb0
1044 changed files with 37502 additions and 63938 deletions

View File

@@ -7,6 +7,7 @@
const SchemaType = require('../schematype');
const symbols = require('./symbols');
const isObject = require('../helpers/isObject');
const utils = require('../utils');
/**
* Mixed SchemaType constructor.
@@ -103,6 +104,9 @@ Mixed.set = SchemaType.set;
*/
Mixed.prototype.cast = function(val) {
if (val instanceof Error) {
return utils.errorToPOJO(val);
}
return val;
};