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

Method changed

src/model.js:3895–3911  ·  view source on GitHub ↗

* 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

3893 * @returns {boolean|Array}
3894 */
3895 changed(key, value) {
3896 if (key === undefined) {
3897 if (this._changed.size > 0) {
3898 return Array.from(this._changed);
3899 }
3900 return false;
3901 }
3902 if (value === true) {
3903 this._changed.add(key);
3904 return this;
3905 }
3906 if (value === false) {
3907 this._changed.delete(key);
3908 return this;
3909 }
3910 return this._changed.has(key);
3911 }
3912
3913 /**
3914 * 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
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
changed.test.jsFile · 0.80

Calls 3

deleteMethod · 0.80
addMethod · 0.45
hasMethod · 0.45

Tested by

no test coverage detected