From 62b31b6a69ae2f2ba7c2fe8240b00187b384304f Mon Sep 17 00:00:00 2001 From: coderaiser Date: Wed, 19 Nov 2014 10:38:18 +0200 Subject: [PATCH] isWritable: simplified --- lib/ncp.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/ncp.js b/lib/ncp.js index bc25a05..3d9f6fa 100644 --- a/lib/ncp.js +++ b/lib/ncp.js @@ -225,11 +225,12 @@ function ncp (source, dest, options, callback) { function isWritable(path, done) { fs.lstat(path, function (err) { - if (err) { - if (err.code === 'ENOENT') return done(true); - return done(false); - } - return done(false); + var result; + + if (err && err.code === 'ENOENT') + result = true; + + done(result); }); }