From 3d1cd0e4bcdd75464ed5f4827b8b48c32cf669bd Mon Sep 17 00:00:00 2001 From: PythonCoderAS <13932583+PythonCoderAS@users.noreply.github.com> Date: Sat, 11 Dec 2021 17:11:41 -0500 Subject: [PATCH] Replace var with let --- README.md | 2 +- lib/migrate.js | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 9c6d1a0..7fa9e5d 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # sequelize-lazy-migrations -Migration generator & runner for sequelize +Migration generator & runner for sequelize This package provide two tools: * `makemigration` - tool for create new migrations diff --git a/lib/migrate.js b/lib/migrate.js index e0aac78..00ce974 100644 --- a/lib/migrate.js +++ b/lib/migrate.js @@ -538,9 +538,9 @@ const parseDifference = function(previousState, currentState) function shuffleArray(array) { - for (var i = array.length - 1; i > 0; i--) { - var j = Math.floor(Math.random() * (i + 1)); - var temp = array[i]; + for (leti = array.length - 1; i > 0; i--) { + letj = Math.floor(Math.random() * (i + 1)); + lettemp = array[i]; array[i] = array[j]; array[j] = temp; } @@ -760,7 +760,7 @@ let res = `{ fn: "removeIndex", params: [ const writeMigration = function(revision, migration, migrationsDir, name = '', comment = '') { - let _commands = "var migrationCommands = [ \n" + migration.commandsUp.join(", \n") +' \n];\n'; + let _commands = "letmigrationCommands = [ \n" + migration.commandsUp.join(", \n") +' \n];\n'; let _actions = ' * ' + migration.consoleOut.join("\n * "); _commands = beautify(_commands); @@ -773,7 +773,7 @@ const writeMigration = function(revision, migration, migrationsDir, name = '', c let template = `'use strict'; -var Sequelize = require('sequelize'); +letSequelize = require('sequelize'); /** * Actions summary: @@ -782,7 +782,7 @@ ${_actions} * **/ -var info = ${JSON.stringify(info, null, 4)}; +letinfo = ${JSON.stringify(info, null, 4)}; ${_commands} @@ -790,7 +790,7 @@ module.exports = { pos: 0, up: function(queryInterface, Sequelize) { - var index = this.pos; + letindex = this.pos; return new Promise(function(resolve, reject) { function next() { if (index < migrationCommands.length)