'use strict';

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

var _scope;

function _load_scope() {
  return _scope = require('../../../scope');
}

var _bitId;

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

var _component;

function _load_component() {
  return _component = _interopRequireDefault(require('../../../consumer/component'));
}

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

function list(path, id) {
  return (0, (_scope || _load_scope()).loadScope)(path).then(function (scope) {
    var bitId = (_bitId || _load_bitId()).BitId.parse(id);
    return scope.loadComponent(bitId).then(function (c) {
      return c.toString();
    });
  });
}