'use strict';

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

var _defineProperty2 = require('babel-runtime/helpers/defineProperty');

var _defineProperty3 = _interopRequireDefault(_defineProperty2);

exports['default'] = getPackageRoute;

var _path = require('path');

var _path2 = _interopRequireDefault(_path);

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

function getPackageRoute(packageInfo) {
  var base = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '.';

  if (packageInfo) {
    var main = packageInfo.main,
        name = packageInfo.name;
    // return { [name.slice(name.lastIndexOf('-') + 1)]: path.join(base, main) };

    return (0, _defineProperty3['default'])({}, name, _path2['default'].join(base, main));
  }
}