'use strict';Object.defineProperty(exports, "__esModule", { value: true });exports.




















walkSync = walkSync;var _path = require('path');var _path2 = _interopRequireDefault(_path);var _fs = require('fs');function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { 'default': obj };} /** @typedef {{ name: string, path: string, dirent: import('fs').Dirent }} Entry */ /**
                                                                                                                                                                                                                                                                                                        * Do a comprehensive walk of the provided src directory, and collect all entries.  Filter out
                                                                                                                                                                                                                                                                                                        * any directories or entries using the optional filter functions.
                                                                                                                                                                                                                                                                                                        * @param {string} root - path to the root of the folder we're walking
                                                                                                                                                                                                                                                                                                        * @param {{ deepFilter?: (entry: Entry) => boolean, entryFilter?: (entry: Entry) => boolean }} options
                                                                                                                                                                                                                                                                                                        * @param {Entry} currentEntry - entry for the current directory we're working in
                                                                                                                                                                                                                                                                                                        * @param {Entry[]} existingEntries - list of all entries so far
                                                                                                                                                                                                                                                                                                        * @returns {Entry[]} an array of directory entries
                                                                                                                                                                                                                                                                                                        */ /**
                                                                                                                                                                                                                                                                                                            * This is intended to provide similar capability as the sync api from @nodelib/fs.walk, until `eslint-plugin-import`
                                                                                                                                                                                                                                                                                                            * is willing to modernize and update their minimum node version to at least v16.  I intentionally made the
                                                                                                                                                                                                                                                                                                            * shape of the API (for the part we're using) the same as @nodelib/fs.walk so that that can be swapped in
                                                                                                                                                                                                                                                                                                            * when the repo is ready for it.
                                                                                                                                                                                                                                                                                                            */function walkSync(root, options, currentEntry, existingEntries) {// Extract the filter functions. Default to evaluating true, if no filter passed in.
  var _options$deepFilter = options.deepFilter,deepFilter = _options$deepFilter === undefined ? function () {return true;} : _options$deepFilter,_options$entryFilter = options.entryFilter,entryFilter = _options$entryFilter === undefined ? function () {return true;} : _options$entryFilter;var entryList = existingEntries || [];var currentRelativePath = currentEntry ? currentEntry.path : '.';var fullPath = currentEntry ? _path2['default'].join(root, currentEntry.path) : root;var dirents = (0, _fs.readdirSync)(fullPath, { withFileTypes: true });dirents.forEach(function (dirent) {/** @type {Entry} */var entry = { name: dirent.name, path: _path2['default'].join(currentRelativePath, dirent.name), dirent: dirent };


    if (dirent.isDirectory() && deepFilter(entry)) {
      entryList.push(entry);
      entryList = walkSync(root, options, entry, entryList);
    } else if (dirent.isFile() && entryFilter(entry)) {
      entryList.push(entry);
    }
  });

  return entryList;
}
//# sourceMappingURL=data:application/json;charset=utf-8;base64, 