From ee02d2fc00a110926e655460a94c344d45ad19e1 Mon Sep 17 00:00:00 2001 From: sang Date: Tue, 15 Mar 2016 16:16:54 +0800 Subject: [PATCH] fix 'TypeError: callback is not a function' --- lib/empty/index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/empty/index.js b/lib/empty/index.js index 23172bdc..a17cbae1 100644 --- a/lib/empty/index.js +++ b/lib/empty/index.js @@ -4,6 +4,7 @@ var mkdir = require('../mkdirs') var remove = require('../remove') function emptyDir (dir, callback) { + callback = callback || function () {} fs.readdir(dir, function (err, items) { if (err) return mkdir.mkdirs(dir, callback)