Skip to content

Commit

Permalink
code cleanup - replace var by let or const
Browse files Browse the repository at this point in the history
  • Loading branch information
silkentrance committed Feb 7, 2020
1 parent ba70579 commit f3c3ab8
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions lib/tmp.js
Expand Up @@ -56,7 +56,7 @@ let
* @private
*/
function _randomChars(howMany) {
var
let
value = [],
rnd = null;

Expand Down Expand Up @@ -253,7 +253,7 @@ function _assertIsRelative(name, option, tmpDir) {
* @param {?tmpNameCallback} callback the callback function
*/
function tmpName(options, callback) {
let
const
args = _parseArguments(options, callback),
opts = args[0],
cb = args[1];
Expand Down Expand Up @@ -295,7 +295,7 @@ function tmpName(options, callback) {
* @throws {Error} if the options are invalid or could not generate a filename
*/
function tmpNameSync(options) {
var
const
args = _parseArguments(options),
opts = args[0];

Expand All @@ -321,7 +321,7 @@ function tmpNameSync(options) {
* @param {?fileCallback} callback
*/
function file(options, callback) {
var
const
args = _parseArguments(options, callback),
opts = args[0],
cb = args[1];
Expand Down Expand Up @@ -359,7 +359,7 @@ function file(options, callback) {
* @throws {Error} if cannot create a file
*/
function fileSync(options) {
var
const
args = _parseArguments(options),
opts = args[0];

Expand All @@ -386,7 +386,7 @@ function fileSync(options) {
* @param {?dirCallback} callback
*/
function dir(options, callback) {
var
const
args = _parseArguments(options, callback),
opts = args[0],
cb = args[1];
Expand Down Expand Up @@ -414,7 +414,7 @@ function dir(options, callback) {
* @throws {Error} if it cannot create a directory
*/
function dirSync(options) {
var
const
args = _parseArguments(options),
opts = args[0];

Expand Down Expand Up @@ -457,7 +457,7 @@ function _removeFileAsync(fdPath, next) {
* @private
*/
function _removeFileSync(fdPath) {
var rethrownException = null;
let rethrownException = null;
try {
if (0 <= fdPath[0]) fs.closeSync(fdPath[0]);
} catch (e) {
Expand Down Expand Up @@ -535,7 +535,7 @@ function _prepareTmpDirRemoveCallback(name, opts, sync) {
* @private
*/
function _prepareRemoveCallback(removeFunction, fileOrDirName, sync, cleanupCallbackSync) {
var called = false;
let called = false;

// if sync is true, the next parameter will be ignored
return function _cleanupCallback(next) {
Expand Down

0 comments on commit f3c3ab8

Please sign in to comment.