UNPKG

bit-bin

Version:

<a href="https://opensource.org/licenses/Apache-2.0"><img alt="apache" src="https://img.shields.io/badge/License-Apache%202.0-blue.svg"></a> <a href="https://github.com/teambit/bit/blob/master/CONTRIBUTING.md"><img alt="prs" src="https://img.shields.io/b

43 lines (32 loc) 1.26 kB
"use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; function _defineProperty2() { const data = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty")); _defineProperty2 = function () { return data; }; return data; } class ComponentWithDependencies { constructor(props) { (0, _defineProperty2().default)(this, "component", void 0); (0, _defineProperty2().default)(this, "dependencies", void 0); (0, _defineProperty2().default)(this, "devDependencies", void 0); (0, _defineProperty2().default)(this, "extensionDependencies", void 0); this.component = props.component; this.dependencies = props.dependencies || []; this.devDependencies = props.devDependencies || []; this.extensionDependencies = props.extensionDependencies || []; } // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX! get allDependencies() { return [...this.dependencies, ...this.devDependencies, ...this.extensionDependencies]; } hasDependency(id) { this.allDependencies.some(dependency => dependency.id.isEqual(id)); } } exports.default = ComponentWithDependencies;