Refactoring day1

This commit is contained in:
2020-08-20 20:27:14 +02:00
parent 6aceefeb2f
commit b907489a75
481 changed files with 5321 additions and 5616 deletions

View File

@@ -224,30 +224,6 @@ SchemaBoolean.prototype.castForQuery = function($conditional, val) {
return this._castForQuery($conditional);
};
/**
*
* @api private
*/
SchemaBoolean.prototype._castNullish = function _castNullish(v) {
if (typeof v === 'undefined' && this.$$context != null && this.$$context._mongooseOptions.omitUndefined) {
return v;
}
const castBoolean = typeof this.constructor.cast === 'function' ?
this.constructor.cast() :
SchemaBoolean.cast();
if (castBoolean == null) {
return v;
}
if (castBoolean.convertToFalse instanceof Set && castBoolean.convertToFalse.has(v)) {
return false;
}
if (castBoolean.convertToTrue instanceof Set && castBoolean.convertToTrue.has(v)) {
return true;
}
return v;
};
/*!
* Module exports.
*/