Skip to content

Commit

Permalink
Manual decaf path-replacer.js
Browse files Browse the repository at this point in the history
  • Loading branch information
confused-Techie committed Jan 7, 2025
1 parent a954d21 commit 617e1fb
Showing 1 changed file with 5 additions and 14 deletions.
19 changes: 5 additions & 14 deletions src/path-replacer.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
/*
* decaffeinate suggestions:
* DS002: Fix invalid constructor
* DS102: Remove unnecessary code created because of implicit returns
* DS207: Consider shorter variations of null checks
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
*/
let PathReplacer;
const fs = require('fs');
const temp = require('temp').track();
const {EventEmitter} = require('events');
Expand Down Expand Up @@ -38,11 +30,10 @@ class ReplaceTransformer extends Transform {
}

module.exports =
(PathReplacer = class PathReplacer extends EventEmitter {
constructor(param) {
if (param == null) { param = {}; }
const {dryReplace} = param;
this.dryReplace = dryReplace;
class PathReplacer extends EventEmitter {
constructor(param = {}) {
super();
this.dryReplace = param?.dryReplace;
}

replacePaths(regex, replacementText, paths, doneCallback) {
Expand Down Expand Up @@ -108,4 +99,4 @@ module.exports =

return reader.pipe(replacer).pipe(output);
}
});
}

0 comments on commit 617e1fb

Please sign in to comment.