Skip to content

Commit b14042e

Browse files
committed
Inline processFiles
1 parent 4077196 commit b14042e

File tree

1 file changed

+7
-16
lines changed

1 file changed

+7
-16
lines changed

index.js

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -51,15 +51,15 @@ function makeCopier(copyConfig, assetManager, { compact } = {}) {
5151
let { fingerprint } = copyConfig;
5252
let compactors = (compact && copyConfig.compact) || {};
5353

54-
return filepaths => {
55-
return Promise.all([
54+
return async filepaths => {
55+
let [filenames, targetDir] = await Promise.all([
5656
(filepaths ? fileFinder.match(filepaths) : fileFinder.all()),
5757
determineTargetDir(source, target)
58-
]).then(([filenames, targetDir]) => {
59-
return processFiles(filenames, {
60-
assetManager, source, target, targetDir, compactors, fingerprint
61-
});
62-
});
58+
]);
59+
60+
return Promise.all(filenames.map(filename => processFile(filename, {
61+
assetManager, source, target, targetDir, compactors, fingerprint
62+
})));
6363
};
6464
}
6565

@@ -76,15 +76,6 @@ function determineTargetDir(source, target) {
7676
then(results => results.isDirectory() ? target : path.dirname(target));
7777
}
7878

79-
/**
80-
* @param {string[]} filenames
81-
* @param {ProcessFile} config
82-
* @returns {Promise<unknown>}
83-
*/
84-
function processFiles(filenames, config) {
85-
return Promise.all(filenames.map(filename => processFile(filename, config)));
86-
}
87-
8879
/**
8980
* @param {string} filename
9081
* @param {ProcessFile} opts

0 commit comments

Comments
 (0)