Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: compatible with Node.js 14 #70

Merged
merged 2 commits into from
May 13, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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