Refactoring day1
This commit is contained in:
22
node_modules/mongoose/lib/schema/SingleNestedPath.js
generated
vendored
22
node_modules/mongoose/lib/schema/SingleNestedPath.js
generated
vendored
@@ -175,7 +175,7 @@ SingleNestedPath.prototype.cast = function(val, doc, init, priorVal) {
|
||||
subdoc.init(val);
|
||||
} else {
|
||||
if (Object.keys(val).length === 0) {
|
||||
return new Constructor({}, selected, doc, undefined, { priorDoc: priorVal });
|
||||
return new Constructor({}, selected, doc);
|
||||
}
|
||||
|
||||
return new Constructor(val, selected, doc, undefined, { priorDoc: priorVal });
|
||||
@@ -300,26 +300,6 @@ SingleNestedPath.prototype.discriminator = function(name, schema, value) {
|
||||
return this.caster.discriminators[name];
|
||||
};
|
||||
|
||||
/**
|
||||
* Sets a default option for all SingleNestedPath instances.
|
||||
*
|
||||
* ####Example:
|
||||
*
|
||||
* // Make all numbers have option `min` equal to 0.
|
||||
* mongoose.Schema.Embedded.set('required', true);
|
||||
*
|
||||
* @param {String} option - The option you'd like to set the value for
|
||||
* @param {*} value - value for option
|
||||
* @return {undefined}
|
||||
* @function set
|
||||
* @static
|
||||
* @api public
|
||||
*/
|
||||
|
||||
SingleNestedPath.defaultOptions = {};
|
||||
|
||||
SingleNestedPath.set = SchemaType.set;
|
||||
|
||||
/*!
|
||||
* ignore
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user