broccolijs / broccoli-persistent-filter

MIT License
12 stars 33 forks source link

Allow multiple trees as input to Filter #175

Closed SparshithNR closed 4 years ago

SparshithNR commented 4 years ago

Example:

class Awk extends Filter {
  constructor(inputNode, search, replace, options) {
    options = options || {};
    super(inputNode, {
      annotation: options.annotation
    });
    this.search = search;
    this.replace = replace;
    this.extensions = ['txt'];
    this.targetExtension = 'txt';
  }
  processString(content, relativePath) {
    return content.replace(this.search, this.replace);
  };
}
module.exports = new Awk(['fixture','fixture_2'], 'test', 'real');

Since we are now allowing users to pass two paths/nodes. We avoid a uncessary merge/funnel. Before to achive the above result we had to below sinppet.

let fullTree = mergeTree(['fixture','fixture_2'];
module.exports = new Awk(fullTree, 'test', 'real');
SparshithNR commented 4 years ago

Input output facade is addressed in #187. We will address allowing multiple trees as input in this PR.

SparshithNR commented 4 years ago

Closing this as #188 is addressing this