Skip to content

Commit 83639bc

Browse files
authored
add filter option to applyTransforms (yeoman#456)
1 parent b5c56a4 commit 83639bc

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lib/environment.js

+5-2
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ const {
3434
createYoResolveTransform
3535
} = require('./util/transform');
3636

37+
const {isFilePending} = FileEditor.State;
38+
3739
/**
3840
* Two-step argument splitting function that first splits arguments in quotes,
3941
* and then splits up the remaining arguments if they are not part of a quote.
@@ -1230,12 +1232,13 @@ class Environment extends Base {
12301232
/**
12311233
* Apply transform streams to file in MemFs.
12321234
* @param {Transform[]} transformStreams - transform streams to be applied.
1233-
* @param {Stream} [stream] - files stream, defaults to this.sharedFs.stream().
1235+
* @param {{ streamOptions: any; stream: Stream; name: string; log: boolean }} [options] - files stream, defaults to this.sharedFs.stream().
12341236
* @return {Promise}
12351237
*/
12361238
applyTransforms(transformStreams, options = {}) {
12371239
const {
1238-
stream = this.sharedFs.stream(),
1240+
streamOptions = {filter: file => isFilePending(file)},
1241+
stream = this.sharedFs.stream(streamOptions),
12391242
name = 'Transforming'
12401243
} = options;
12411244

0 commit comments

Comments
 (0)