Skip to content

Commit

Permalink
Undo autoformatting
Browse files Browse the repository at this point in the history
  • Loading branch information
jridgewell committed Apr 29, 2021
1 parent 2e1e35b commit 8cdb1fd
Showing 1 changed file with 10 additions and 16 deletions.
26 changes: 10 additions & 16 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const checkCwdOption = (options = {}) => {
}
};

const getPathString = p => (p.stats instanceof fs.Stats ? p.path : p);
const getPathString = p => p.stats instanceof fs.Stats ? p.path : p;

const generateGlobTasks = (patterns, taskOptions) => {
patterns = arrayUnion([].concat(patterns));
Expand Down Expand Up @@ -93,8 +93,7 @@ const globDirs = (task, fn) => {

const getIgnoreFiles = options => options && options.gitignore ? '**/.gitignore' : options && options.ignoreFiles;

const getPattern = (task, fn) =>
task.options.expandDirectories ? globDirs(task, fn) : [task.pattern];
const getPattern = (task, fn) => task.options.expandDirectories ? globDirs(task, fn) : [task.pattern];

const getFilterSync = options => {
const ignoreFiles = getIgnoreFiles(options);
Expand Down Expand Up @@ -126,20 +125,16 @@ module.exports = async (patterns, options) => {
};

const getTasks = async () => {
const tasks = await Promise.all(
globTasks.map(async task => {
const globs = await getPattern(task, dirGlob);
return Promise.all(globs.map(globToTask(task)));
})
);
const tasks = await Promise.all(globTasks.map(async task => {
const globs = await getPattern(task, dirGlob);
return Promise.all(globs.map(globToTask(task)));
}));

return arrayUnion(...tasks);
};

const [filter, tasks] = await Promise.all([getFilter(), getTasks()]);
const paths = await Promise.all(
tasks.map(task => fastGlob(task.pattern, task.options))
);
const paths = await Promise.all(tasks.map(task => fastGlob(task.pattern, task.options)));

return arrayUnion(...paths).filter(path_ => !filter(getPathString(path_)));
};
Expand Down Expand Up @@ -183,10 +178,9 @@ module.exports.stream = (patterns, options) => {

module.exports.generateGlobTasks = generateGlobTasks;

module.exports.hasMagic = (patterns, options) =>
[]
.concat(patterns)
.some(pattern => fastGlob.isDynamicPattern(pattern, options));
module.exports.hasMagic = (patterns, options) => []
.concat(patterns)
.some(pattern => fastGlob.isDynamicPattern(pattern, options));

module.exports.ignoreFiles = ignore;
module.exports.gitignore = options => ignore('**/.gitignore', options);
Expand Down

0 comments on commit 8cdb1fd

Please sign in to comment.