From 67ea230e07e8f9d42765e1a29a5ae063005f19e5 Mon Sep 17 00:00:00 2001 From: Alexei Kozachenko Date: Sat, 22 Sep 2018 23:45:20 -0400 Subject: [PATCH] Added/fixed mkdtemp method (issue 441) --- src/filesystem/implementation.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/filesystem/implementation.js b/src/filesystem/implementation.js index f0f1baf..139d434 100644 --- a/src/filesystem/implementation.js +++ b/src/filesystem/implementation.js @@ -1687,19 +1687,19 @@ function mkdtemp(fs, context, prefix, options, callback) { return 'xxxxxx'.replace(/[xy]/g, function(c) { var r = Math.random()*16|0, v = c == 'x' ? r : (r&0x3|0x8); return v.toString(16); - }) + }); } if (prefix) { - var path = "/"+prefix+generateRandom(); + var path = '/'+prefix+generateRandom(); make_directory(context, path, function(error) { if (error) { - callback(error, path) + callback(error, path); } else { callback(null, path); } }); } else { - callback(new Error('filename prefix is required'), prefix) + callback(new Error('filename prefix is required'), prefix); } }