'use strict';

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

var _findUp;

function _load_findUp() {
  return _findUp = _interopRequireDefault(require('find-up'));
}

var _parseGitignore;

function _load_parseGitignore() {
  return _parseGitignore = _interopRequireDefault(require('parse-gitignore'));
}

var _constants;

function _load_constants() {
  return _constants = require('../../constants');
}

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

function getGitIgnoreFile(dir) {
  var gitIgnoreFile = (_findUp || _load_findUp()).default.sync([(_constants || _load_constants()).GIT_IGNORE], { cwd: dir });
  return gitIgnoreFile ? (0, (_parseGitignore || _load_parseGitignore()).default)(gitIgnoreFile) : [];
}
function retrieveIgnoreList(cwd) {
  // $FlowFixMe
  var ignoreList = getGitIgnoreFile(cwd).concat((_constants || _load_constants()).IGNORE_LIST);
  return ignoreList;
}