'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});

var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();

var _bitId;

function _load_bitId() {
  return _bitId = _interopRequireDefault(require('../bit-id/bit-id'));
}

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

var ComponentWithDependencies = function () {
  function ComponentWithDependencies(props) {
    _classCallCheck(this, ComponentWithDependencies);

    this.component = props.component;
    this.dependencies = props.dependencies || [];
    this.devDependencies = props.devDependencies || [];
    this.compilerDependencies = props.compilerDependencies || [];
    this.testerDependencies = props.testerDependencies || [];
  }

  _createClass(ComponentWithDependencies, [{
    key: 'hasDependency',
    value: function hasDependency(id) {
      this.allDependencies.some(function (dependency) {
        return dependency.id.isEqual(id);
      });
    }
  }, {
    key: 'allDependencies',
    get: function get() {
      return [].concat(_toConsumableArray(this.dependencies), _toConsumableArray(this.devDependencies), _toConsumableArray(this.compilerDependencies), _toConsumableArray(this.testerDependencies));
    }
  }]);

  return ComponentWithDependencies;
}();

exports.default = ComponentWithDependencies;