'use strict';

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

var _path;

function _load_path() {
  return _path = _interopRequireWildcard(require('path'));
}

var _consumer;

function _load_consumer() {
  return _consumer = _interopRequireDefault(require('./consumer'));
}

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

function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }

function loadConsumer(currentPath) {
  var throws = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;

  if (!currentPath) currentPath = process.cwd();
  return (_consumer || _load_consumer()).default.load((_path || _load_path()).resolve(currentPath), throws);
}