"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;

function _bitId() {
  const data = _interopRequireDefault(require("../bit-id/bit-id"));

  _bitId = function () {
    return data;
  };

  return data;
}

class ComponentWithDependencies {
  constructor(props) {
    this.component = props.component;
    this.dependencies = props.dependencies || [];
    this.devDependencies = props.devDependencies || [];
    this.compilerDependencies = props.compilerDependencies || [];
    this.testerDependencies = props.testerDependencies || [];
  }

  get allDependencies() {
    return [...this.dependencies, ...this.devDependencies, ...this.compilerDependencies, ...this.testerDependencies];
  }

  hasDependency(id) {
    this.allDependencies.some(dependency => dependency.id.isEqual(id));
  }

}

exports.default = ComponentWithDependencies;