MCPcopy
hub / github.com/sequelize/sequelize / warnOnInvalidOptions

Method warnOnInvalidOptions

lib/model.js:1783–1793  ·  lib/model.js::Model.warnOnInvalidOptions
(options, validColumnNames)

Source from the content-addressed store, hash-verified

1781 }
1782
1783 static warnOnInvalidOptions(options, validColumnNames) {
1784 if (!_.isPlainObject(options)) {
1785 return;
1786 }
1787
1788 const unrecognizedOptions = Object.keys(options).filter(k => !validQueryKeywords.has(k));
1789 const unexpectedModelAttributes = _.intersection(unrecognizedOptions, validColumnNames);
1790 if (!options.where && unexpectedModelAttributes.length > 0) {
1791 logger.warn(`Model attributes (${unexpectedModelAttributes.join(class="st">', ')}) passed into finder method options of model ${this.name}, but the options.where object is empty. Did you forget to use options.where?`);
1792 }
1793 }
1794
1795 static _injectDependentVirtualAttributes(attributes) {
1796 if (!this._hasVirtualAttributes) return attributes;

Callers 2

findAllMethod · 0.95
findall.test.jsFile · 0.80

Calls 2

warnMethod · 0.65
hasMethod · 0.45

Tested by

no test coverage detected