Skip to content

Commit

Permalink
Cleans all 'var' statements
Browse files Browse the repository at this point in the history
  • Loading branch information
sgobotta committed Oct 21, 2018
1 parent d8493cb commit 9693f87
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 19 deletions.
6 changes: 3 additions & 3 deletions app/src/renderer/connectors/lcdClientMock.js
Original file line number Diff line number Diff line change
Expand Up @@ -678,10 +678,10 @@ module.exports = {
}

function makeHash() {
var text = ``
var possible = `ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789`
let text = ``
const possible = `ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789`

for (var i = 0; i < 40; i++) {
for (let i = 0; i < 40; i++) {
text += possible.charAt(Math.floor(Math.random() * possible.length))
}
return b32.encode(text)
Expand Down
6 changes: 3 additions & 3 deletions app/src/renderer/connectors/rpcWrapperMock.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,10 @@ async function produceBlocks(cb) {
}

function makeBlockHash() {
var text = ``
var possible = `ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789`
let text = ``
const possible = `ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789`

for (var i = 0; i < 40; i++) {
for (let i = 0; i < 40; i++) {
text += possible.charAt(Math.floor(Math.random() * possible.length))
}

Expand Down
2 changes: 1 addition & 1 deletion app/src/renderer/vuex/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Vue.use(Vuex)
export default (opts = {}) => {
opts.commit = (...args) => store.commit(...args)
opts.dispatch = (...args) => store.dispatch(...args)
var store = new Vuex.Store({
const store = new Vuex.Store({
getters,
// strict: true,
modules: modules(opts),
Expand Down
14 changes: 7 additions & 7 deletions tasks/build/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ const zip = require(`deterministic-zip`)
const path = require(`path`)
const packager = util.promisify(require(`electron-packager`))
const fs = require(`fs-extra`)
var glob = require(`glob`)
const glob = require(`glob`)
const zlib = require(`zlib`)
var tar = require(`tar-stream`)
var duplexer = require(`duplexer`)
const tar = require(`tar-stream`)
const duplexer = require(`duplexer`)
const packageJson = require(`../../package.json`)

const generateAppPackageJson = packageJson =>
Expand Down Expand Up @@ -67,7 +67,7 @@ const zipFolder = async (inDir, outDir) => {

async function tarFolder(inDir, outDir) {
let outFile = path.join(outDir, `${path.basename(inDir)}.tar.gz`)
var pack = tar.pack()
const pack = tar.pack()

let files = glob(inDir + `/**`, { sync: true })

Expand Down Expand Up @@ -118,11 +118,11 @@ async function tarFolder(inDir, outDir) {
}

function deterministicTar() {
var UNIXZERO = new Date(new Date().getTimezoneOffset() * -1)
const UNIXZERO = new Date(new Date().getTimezoneOffset() * -1)

var pack = tar.pack()
const pack = tar.pack()

var extract = tar
const extract = tar
.extract()
.on(`entry`, function(header, stream, cb) {
header.mtime = header.atime = header.ctime = UNIXZERO
Expand Down
2 changes: 1 addition & 1 deletion tasks/build/local/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
const os = require(`os`)
const fs = require(`fs-extra`)
const { cli } = require(`@nodeguy/cli`)
var path = require(`path`)
const path = require(`path`)
const homeDir = require(`os`).homedir()
const appDir = path.resolve(__dirname + `/../../../`)

Expand Down
4 changes: 2 additions & 2 deletions tasks/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
// on windows some processes are not exiting when using child.kill so we use a windows specific comand
module.exports.cleanExitChild = function(child) {
return new Promise(resolve => {
var isWin = /^win/.test(process.platform)
const isWin = /^win/.test(process.platform)
if (!isWin) {
child.kill(`SIGTERM`)
} else {
var cp = require(`child_process`)
const cp = require(`child_process`)
cp.exec(`taskkill /PID ` + child.pid + ` /T /F`, function(error) {
if (error !== null) {
console.log(`exec error: ` + error)
Expand Down
4 changes: 2 additions & 2 deletions tasks/windows-installer.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"use strict"

var electronInstaller = require(`electron-winstaller`)
var { author, version } = require(`../package.json`)
const electronInstaller = require(`electron-winstaller`)
const { author, version } = require(`../package.json`)

// Installer is customizable: https://github.com/electron/windows-installer
let resultPromise = electronInstaller.createWindowsInstaller({
Expand Down

0 comments on commit 9693f87

Please sign in to comment.