'use strict';

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

var _path;

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

var _fs;

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

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 (_fs || _load_fs()).default.readdirSync(dirPath).filter(function (file) {
    return (_fs || _load_fs()).default.statSync((_path || _load_path()).default.join(dirPath, file)).isDirectory();
  });
}