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

Method equals

lib/model.js:4394–4404  ·  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

4392 * @returns {boolean}
4393 */
4394 equals(other) {
4395 if (!other || !other.constructor) {
4396 return false;
4397 }
4398
4399 if (!(other instanceof this.constructor)) {
4400 return false;
4401 }
4402
4403 return this.constructor.primaryKeyAttributes.every(attribute => this.get(attribute, { raw: true }) === other.get(attribute, { raw: true }));
4404 }
4405
4406 /**
4407 * 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