Skip to content

Commit 4c005ca

Browse files
committed
fix(node): full node 14 support
1 parent ff26392 commit 4c005ca

File tree

3 files changed

+472
-170
lines changed

3 files changed

+472
-170
lines changed

lib/common/file-system.ts

+5
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,11 @@ export class FileSystem implements IFileSystem {
205205

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

0 commit comments

Comments
 (0)