MCPcopy
hub / github.com/sequelize/sequelize / changed

Method changed

lib/model.js:3769–3785  ·  lib/model.js::Model.changed

* If changed is called with a string it will return a boolean indicating whether the value of that key in `dataValues` is different from the value in `_previousDataValues`. * * If changed is called without an argument, it will return an array of keys that have changed. * * If changed is

(key, value)

Source from the content-addressed store, hash-verified

3767 * @returns {boolean|Array}
3768 */
3769 changed(key, value) {
3770 if (key === undefined) {
3771 if (this._changed.size > 0) {
3772 return Array.from(this._changed);
3773 }
3774 return false;
3775 }
3776 if (value === true) {
3777 this._changed.add(key);
3778 return this;
3779 }
3780 if (value === false) {
3781 this._changed.delete(key);
3782 return this;
3783 }
3784 return this._changed.has(key);
3785 }
3786
3787 /**
3788 * Returns the previous value for key from `_previousDataValues`.

Callers 13

updateMethod · 0.95
setDataValueMethod · 0.95
setMethod · 0.95
previousMethod · 0.95
saveMethod · 0.95
recursiveBulkCreateMethod · 0.80
belongs-to.test.jsFile · 0.80
update.test.jsFile · 0.80
values.test.jsFile · 0.80
update.test.jsFile · 0.80
set.test.jsFile · 0.80

Calls 3

deleteMethod · 0.80
addMethod · 0.45
hasMethod · 0.45

Tested by

no test coverage detected