From e78b38c4dc471e9ea2f6621ec7cb9a9d06db6f6e Mon Sep 17 00:00:00 2001 From: coderaiser Date: Wed, 9 Apr 2014 03:14:31 -0400 Subject: [PATCH] refactor(rest) copy -> fse --- lib/server/rest.js | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/lib/server/rest.js b/lib/server/rest.js index a74c67ef..d5215e33 100644 --- a/lib/server/rest.js +++ b/lib/server/rest.js @@ -36,12 +36,14 @@ NOT_LOG = true, - copy = main.srvrequire('ncp') || function(from, to, callback) { - pipe.create({ - from : from, - to : to, - callback : callback - }); + fse = { + copy: main.srvrequire('ncp') || function(from, to, callback) { + pipe.create({ + from : from, + to : to, + callback : callback + }); + } }; /** @@ -277,7 +279,7 @@ if (!Util.checkObjTrue(lFiles, ['from', 'to'])) sendError(pParams, p.data); else - copy(lFiles.from, lFiles.to, function(error) { + fse.copy(lFiles.from, lFiles.to, function(error) { if (error) sendError(pParams, error); else