MCPcopy Index your code
hub / github.com/sequelize/sequelize / defaults

Function defaults

src/utils.js:589–611  ·  view source on GitHub ↗

* Assigns own and inherited enumerable string and symbol keyed properties of source * objects to the destination object. * * https://lodash.com/docs/4.17.4#defaults * * **Note:** This method mutates `object`. * * @param {object} object The destination object. * @param {...object} [sources] T

(object, ...sources)

Source from the content-addressed store, hash-verified

587 * @private
588 */
589function defaults(object, ...sources) {
590 object = Object(object);
591
592 sources.forEach(source => {
593 if (source) {
594 source = Object(source);
595
596 getComplexKeys(source).forEach(key => {
597 const value = object[key];
598 if (
599 value === undefined ||
600 _.eq(value, Object.prototype[key]) &&
601 !Object.prototype.hasOwnProperty.call(object, key)
602
603 ) {
604 object[key] = source[key];
605 }
606 });
607 }
608 });
609
610 return object;
611}
612exports.defaults = defaults;
613
614/**

Callers

nothing calls this directly

Calls 1

getComplexKeysFunction · 0.85

Tested by

no test coverage detected