From 4a0bd796447d5d38ae2641a2984848af0575dd19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Legan=C3=A9s-Combarro=20=27piranna?= Date: Tue, 11 Oct 2016 20:55:07 +0200 Subject: [PATCH] Fix whitespaces --- index.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/index.js b/index.js index 3fa335f..71f6621 100644 --- a/index.js +++ b/index.js @@ -2,9 +2,10 @@ var tmp = require("tmp"); var Promise = require("bluebird"); -// file +// file module.exports.fileSync = tmp.fileSync; var file = Promise.promisify(tmp.file, {multiArgs: true}); + module.exports.file = function file$promise() { return file.apply(tmp, arguments).spread(function (path, fd, cleanup) { return {path: path, fd: fd, cleanup : cleanup }; @@ -13,16 +14,18 @@ module.exports.file = function file$promise() { module.exports.withFile = function withFile(fn) { var cleanup; - return module.exports.file.apply(tmp).then(function context(o) { + return module.exports.file.apply(tmp).then(function context(o) { cleanup = o.cleanup; delete o.cleanup; return fn(o); }).finally(cleanup); }; -// directory + +// directory module.exports.dirSync = tmp.dirSync; var dir = Promise.promisify(tmp.dir, {multiArgs: true}); + module.exports.dir = function dir$promise() { return dir.apply(tmp, arguments).spread(function (path, cleanup) { return {path: path, cleanup: cleanup}; @@ -31,19 +34,18 @@ module.exports.dir = function dir$promise() { module.exports.withDir = function withDir(fn) { var cleanup; - return module.exports.dir.apply(tmp, arguments).then(function context(o) { + return module.exports.dir.apply(tmp, arguments).then(function context(o) { cleanup = o.cleanup; delete o.cleanup; return fn(o); }).finally(cleanup); }; + // name generation module.exports.tmpNameSync = tmp.tmpNameSync; module.exports.tmpName = Promise.promisify(tmp.tmpName); - module.exports.tmpdir = tmp.tmpdir; - module.exports.setGracefulCleanup = tmp.setGracefulCleanup;