aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts/lib/migrator/index.js
diff options
context:
space:
mode:
authorDan Finlay <dan@danfinlay.com>2017-04-28 06:10:16 +0800
committerDan Finlay <dan@danfinlay.com>2017-04-28 06:10:16 +0800
commita9a39bdf8f2b95e8401de6410797a703df91a4e1 (patch)
tree3bc128f651dcd956992fdb2e257269e6507a2f86 /app/scripts/lib/migrator/index.js
parentf1beb0720a0964e45a71b473f173f62c6abdac6e (diff)
parentd8a5e6a8e43f04a9f123167326fe46dfb8fc2ae6 (diff)
downloadtangerine-wallet-browser-a9a39bdf8f2b95e8401de6410797a703df91a4e1.tar
tangerine-wallet-browser-a9a39bdf8f2b95e8401de6410797a703df91a4e1.tar.gz
tangerine-wallet-browser-a9a39bdf8f2b95e8401de6410797a703df91a4e1.tar.bz2
tangerine-wallet-browser-a9a39bdf8f2b95e8401de6410797a703df91a4e1.tar.lz
tangerine-wallet-browser-a9a39bdf8f2b95e8401de6410797a703df91a4e1.tar.xz
tangerine-wallet-browser-a9a39bdf8f2b95e8401de6410797a703df91a4e1.tar.zst
tangerine-wallet-browser-a9a39bdf8f2b95e8401de6410797a703df91a4e1.zip
Merge branch 'master' into Version-3.5.4
Diffstat (limited to 'app/scripts/lib/migrator/index.js')
-rw-r--r--app/scripts/lib/migrator/index.js12
1 files changed, 6 insertions, 6 deletions
diff --git a/app/scripts/lib/migrator/index.js b/app/scripts/lib/migrator/index.js
index 312345263..c40c347b5 100644
--- a/app/scripts/lib/migrator/index.js
+++ b/app/scripts/lib/migrator/index.js
@@ -3,17 +3,17 @@ const asyncQ = require('async-q')
class Migrator {
constructor (opts = {}) {
- let migrations = opts.migrations || []
+ const migrations = opts.migrations || []
this.migrations = migrations.sort((a, b) => a.version - b.version)
- let lastMigration = this.migrations.slice(-1)[0]
+ const lastMigration = this.migrations.slice(-1)[0]
// use specified defaultVersion or highest migration version
this.defaultVersion = opts.defaultVersion || (lastMigration && lastMigration.version) || 0
}
// run all pending migrations on meta in place
migrateData (versionedData = this.generateInitialState()) {
- let remaining = this.migrations.filter(migrationIsPending)
-
+ const remaining = this.migrations.filter(migrationIsPending)
+
return (
asyncQ.eachSeries(remaining, (migration) => this.runMigration(versionedData, migration))
.then(() => versionedData)
@@ -21,12 +21,12 @@ class Migrator {
// migration is "pending" if hit has a higher
// version number than currentVersion
- function migrationIsPending(migration) {
+ function migrationIsPending (migration) {
return migration.version > versionedData.meta.version
}
}
- runMigration(versionedData, migration) {
+ runMigration (versionedData, migration) {
return (
migration.migrate(versionedData)
.then((versionedData) => {