HEX
Server: Apache
System: Linux srv4.garantili.com.tr 4.18.0-477.21.1.lve.1.el8.x86_64 #1 SMP Tue Sep 5 23:08:35 UTC 2023 x86_64
User: ekspardev (1006)
PHP: 7.4.33
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //home/ekspardev/nokta-logo-entegrasyon/node_modules/sequelize/lib/associations/base.js
"use strict";
const { AssociationError } = require("./../errors");
class Association {
  constructor(source, target, options = {}) {
    this.source = source;
    this.target = target;
    this.options = options;
    this.scope = options.scope;
    this.isSelfAssociation = this.source === this.target;
    this.as = options.as;
    this.associationType = "";
    if (source.hasAlias(options.as)) {
      throw new AssociationError(`You have used the alias ${options.as} in two separate associations. Aliased associations must have unique aliases.`);
    }
  }
  toInstanceArray(input) {
    if (!Array.isArray(input)) {
      input = [input];
    }
    return input.map((element) => {
      if (element instanceof this.target)
        return element;
      const tmpInstance = {};
      tmpInstance[this.target.primaryKeyAttribute] = element;
      return this.target.build(tmpInstance, { isNewRecord: false });
    });
  }
  [Symbol.for("nodejs.util.inspect.custom")]() {
    return this.as;
  }
}
module.exports = Association;
//# sourceMappingURL=base.js.map