MCPcopy
hub / github.com/sequelize/sequelize / equals

Method equals

src/model.js:4554–4564  ·  view source on GitHub ↗

* Check whether this and `other` Instance refer to the same row * * @param {Model} other Other instance to compare against * * @returns {boolean}

(other)

Source from the content-addressed store, hash-verified

4552 * @returns {boolean}
4553 */
4554 equals(other) {
4555 if (!other || !other.constructor) {
4556 return false;
4557 }
4558
4559 if (!(other instanceof this.constructor)) {
4560 return false;
4561 }
4562
4563 return this.constructor.primaryKeyAttributes.every(attribute => this.get(attribute, { raw: true }) === other.get(attribute, { raw: true }));
4564 }
4565
4566 /**
4567 * Check if this is equal to one of `others` by calling equals

Callers 7

equalsOneOfMethod · 0.95
trigger.test.jsFile · 0.80
model.test.jsFile · 0.80
instance.test.jsFile · 0.80
include.test.jsFile · 0.80
to-json.test.jsFile · 0.80

Calls 2

getMethod · 0.95
getMethod · 0.65

Tested by

no test coverage detected