Refactoring day1
This commit is contained in:
24
node_modules/mongoose/lib/schema/boolean.js
generated
vendored
24
node_modules/mongoose/lib/schema/boolean.js
generated
vendored
@@ -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.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user