MCPcopy
hub / github.com/sequelize/sequelize / previous

Method previous

src/model.js:3922–3928  ·  view source on GitHub ↗

* Returns the previous value for key from `_previousDataValues`. * * If called without a key, returns the previous values for all values which have changed * * @param {string} [key] key to get previous value of * * @returns {any|Array }

(key)

Source from the content-addressed store, hash-verified

3920 * @returns {any|Array<any>}
3921 */
3922 previous(key) {
3923 if (key) {
3924 return this._previousDataValues[key];
3925 }
3926
3927 return _.pickBy(this._previousDataValues, (value, key) => this.changed(key));
3928 }
3929
3930 _setInclude(key, value, options) {
3931 if (!Array.isArray(value)) value = [value];

Callers 3

values.test.jsFile · 0.80
model.tsFile · 0.80
previous.test.jsFile · 0.80

Calls 1

changedMethod · 0.95

Tested by

no test coverage detected