Skip to content

Commit

Permalink
fix(node): full node 14 support
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanWalker committed May 30, 2020
1 parent ff26392 commit 4c005ca
Show file tree
Hide file tree
Showing 3 changed files with 472 additions and 170 deletions.
5 changes: 5 additions & 0 deletions lib/common/file-system.ts
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,11 @@ export class FileSystem implements IFileSystem {

public writeFile(filename: string, data: string | Buffer, encoding?: string): void {
this.createDirectory(dirname(filename));
if (!data) {
// node 14 will no longer coerce unsupported input to strings anymore.
// clean any null or undefined data
data = '';
}
fs.writeFileSync(filename, data, { encoding: encoding });
}

Expand Down
Loading

0 comments on commit 4c005ca

Please sign in to comment.