From 9d10ce95f4c612c1d83c854358256373ef605043 Mon Sep 17 00:00:00 2001 From: SukkaW Date: Fri, 24 Apr 2020 17:05:26 +0800 Subject: [PATCH 1/2] fix: compatible with Node.js 14 --- lib/fs.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/fs.js b/lib/fs.js index 6d094da..a29b336 100644 --- a/lib/fs.js +++ b/lib/fs.js @@ -89,6 +89,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 = {}; @@ -127,6 +129,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(() => fsPromises.copyFile(src, dest, flags)).asCallback(callback); @@ -190,7 +193,7 @@ async 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); }), reduceFiles, []); } From 4a4d07ac600f799f94c8511859e311862699c8cb Mon Sep 17 00:00:00 2001 From: SukkaW Date: Fri, 24 Apr 2020 17:43:26 +0800 Subject: [PATCH 2/2] ci(travis): add node 14 --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index a9361a2..a7ba117 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,6 +11,7 @@ node_js: - "10" - "12" - "13" + - "14" script: - npm run eslint