Changes
This commit is contained in:
9
node_modules/mongoose/lib/cast/boolean.js
generated
vendored
9
node_modules/mongoose/lib/cast/boolean.js
generated
vendored
@@ -14,16 +14,17 @@ const CastError = require('../error/cast');
|
||||
*/
|
||||
|
||||
module.exports = function castBoolean(value, path) {
|
||||
if (value == null) {
|
||||
return value;
|
||||
}
|
||||
|
||||
if (module.exports.convertToTrue.has(value)) {
|
||||
return true;
|
||||
}
|
||||
if (module.exports.convertToFalse.has(value)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (value == null) {
|
||||
return value;
|
||||
}
|
||||
|
||||
throw new CastError('boolean', value, path);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user