'use strict';

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

var _path;

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

var _fsExtra;

function _load_fsExtra() {
  return _fsExtra = _interopRequireDefault(require('fs-extra'));
}

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

/**
 * synchronous component for listing directory contents.
 * @param {string} dirPath target dir
 * @returns {string[]} array representing directory contents
 * @example
 * ```js
 *  listDirectories('/usr/local/foo/bar') //=> ['foo.html', 'bar.css']
 * ```
 */
function listDirectories(dirPath) {
  return (_fsExtra || _load_fsExtra()).default.readdirSync(dirPath).filter(function (file) {
    return (_fsExtra || _load_fsExtra()).default.statSync((_path || _load_path()).default.join(dirPath, file)).isDirectory();
  });
}