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
58 lines (45 loc) • 905 B
JavaScript
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
function _bluebird() {
const data = require("bluebird");
_bluebird = function () {
return data;
};
return data;
}
/**
* A facade to resolve a component from the correct host
*
* @export
* @class ComponentResolver
*/
class ComponentResolver {
constructor(scope, workspace) {
this.scope = scope;
this.workspace = workspace;
}
/**
* Get the actual host (workspace or scope)
*
* @readonly
* @memberof ComponentResolver
*/
get host() {
if (this.workspace) {
return this.workspace;
}
return this.scope;
}
getComponent(id) {
return (0, _bluebird().coroutine)(function* () {
if (!id) {
return undefined;
} // TODO: implement
return undefined;
})();
}
}
exports.default = ComponentResolver;
;