Skip to content

Commit

Permalink
fix: compatible with Node.js 14 (#70)
Browse files Browse the repository at this point in the history
* fix: compatible with Node.js 14

* chroe: code format
  • Loading branch information
yoshinorin committed May 13, 2020
1 parent 780a5a9 commit 68e96c7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/fs.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ function checkParentSync(path) {
function writeFile(path, data, options, callback) {
if (!path) throw new TypeError('path is required!');

if (!data) data = '';

if (!callback && typeof options === 'function') {
callback = options;
options = {};
Expand Down Expand Up @@ -139,6 +141,7 @@ function copyFile(src, dest, flags, callback) {
if (!dest) throw new TypeError('dest is required!');
if (typeof flags === 'function') {
callback = flags;
flags = undefined;
}

return checkParent(dest).then(() => _copyFile(src, dest, flags)).asCallback(callback);
Expand Down Expand Up @@ -227,7 +230,7 @@ function _copyDir(src, dest, options, parent) {
return _copyDir(childSrc, childDest, options, currentPath);
}

return copyFile(childSrc, childDest, options).thenReturn(currentPath);
return copyFile(childSrc, childDest).thenReturn(currentPath);
}).reduce(reduceFiles, []);
}

Expand Down

0 comments on commit 68e96c7

Please sign in to comment.