app/scripts/lib/migrator/index.js
// run all pending migrations on meta in place
run all pending migrations on meta in place
run all pending migrations on meta in place
migrateData (versionedData = this.generateInitialState()) {
    let remaining = this.migrations.filter(migrationIsPending)
    return (
      asyncQ.eachSeries(remaining, (migration) => this.runMigration(versionedData, migration))
      .then(() => versionedData)
    )
    function migrationIsPending(migration) {
      return migration.version > versionedData.meta.version
    }
  }
migrateData ( versionedData = this . generateInitialState ( ) ) { let remaining = this . migrations . filter ( migrationIsPending ) return ( asyncQ . eachSeries ( remaining , ( migration ) => this . runMigration ( versionedData , migration ) ) . then ( ( ) => versionedData ) ) function migrationIsPending ( migration ) { return migration . version > versionedData . meta . version } }
run all pending migrations on meta in place
run all pending migrations on meta in place
// migration is "pending" if hit has a higher // version number than currentVersion