refactor: replace var with const / let (#14866)

This commit is contained in:
Milan Burda 2018-09-29 01:17:00 +02:00 committed by Samuel Attard
parent b42493e6e6
commit c61db523c7
26 changed files with 195 additions and 201 deletions

View file

@ -86,13 +86,13 @@ exports.processStart = function () {
// Download the releases specified by the URL and write new results to stdout.
exports.checkForUpdate = function (updateURL, callback) {
return spawnUpdate(['--checkForUpdate', updateURL], false, function (error, stdout) {
var json, ref, ref1, update
let ref, ref1, update
if (error != null) {
return callback(error)
}
try {
// Last line of output is the JSON details about the releases
json = stdout.trim().split('\n').pop()
const json = stdout.trim().split('\n').pop()
update = (ref = JSON.parse(json)) != null ? (ref1 = ref.releasesToApply) != null ? typeof ref1.pop === 'function' ? ref1.pop() : void 0 : void 0 : void 0
} catch (jsonError) {
// Disabled for backwards compatibility: