'use strict';

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

var _fs;

function _load_fs() {
  return _fs = _interopRequireDefault(require('fs'));
}

var _generalError;

function _load_generalError() {
  return _generalError = _interopRequireDefault(require('../error/general-error'));
}

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

function isDir(userPath) {
  var stat = void 0;
  try {
    stat = (_fs || _load_fs()).default.lstatSync(userPath);
  } catch (err) {
    throw new (_generalError || _load_generalError()).default(`The path ${userPath} doesn't exist`);
  }
  return stat.isDirectory();
}