anote-server-libs 0.9.7 → 0.9.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -81,15 +81,12 @@ END`)
81
81
  process.exit(5);
82
82
  if (migrationsAvailable.length && migrationsAvailable.length !== (migrationsAvailable[migrationsAvailable.length - 1].id - migrationsAvailable[0].id + 1))
83
83
  process.exit(5);
84
- let highestCommon = 0;
85
- while (highestCommon < migrations.length
86
- && highestCommon < migrationsAvailable.length
87
- && migrations[highestCommon]
88
- && migrationsAvailable[highestCommon]
84
+ let highestCommon = onlyAboveOrEquals;
85
+ while (highestCommon < migrations.length && highestCommon < migrationsAvailable.length
89
86
  && migrations[highestCommon].hash === migrationsAvailable[highestCommon].hash)
90
87
  highestCommon++;
91
- this.applyDownUntil(migrations, migrations.length, highestCommon).then(appliedId => {
92
- this.applyUpUntil(migrationsAvailable, Math.min(appliedId, migrations.length), migrationsAvailable.length).then(callback, process.exit);
88
+ this.applyDownUntil(migrations, migrations.length, highestCommon).then(highestCommon => {
89
+ this.applyUpUntil(migrationsAvailable, Math.min(highestCommon, migrations.length), migrationsAvailable.length).then(callback, process.exit);
93
90
  }, process.exit);
94
91
  });
95
92
  }, () => process.exit(3));
@@ -78,15 +78,12 @@ END`)])).then(() => {
78
78
  if(onlyBelow) migrations = migrations.filter(m => m.id < onlyBelow);
79
79
  if(migrationsAvailable.length === 0 && migrations.length === 0) process.exit(5);
80
80
  if(migrationsAvailable.length && migrationsAvailable.length !== (migrationsAvailable[migrationsAvailable.length - 1].id - migrationsAvailable[0].id + 1)) process.exit(5);
81
- let highestCommon = 0;
82
- while(highestCommon < migrations.length
83
- && highestCommon < migrationsAvailable.length
84
- && migrations[highestCommon]
85
- && migrationsAvailable[highestCommon]
86
- && migrations[highestCommon].hash === migrationsAvailable[highestCommon].hash)
81
+ let highestCommon = onlyAboveOrEquals;
82
+ while(highestCommon < migrations.length && highestCommon < migrationsAvailable.length
83
+ && migrations[highestCommon].hash === migrationsAvailable[highestCommon].hash)
87
84
  highestCommon++;
88
- this.applyDownUntil(migrations, migrations.length, highestCommon).then(appliedId => {
89
- this.applyUpUntil(migrationsAvailable, Math.min(appliedId, migrations.length), migrationsAvailable.length).then(callback, process.exit);
85
+ this.applyDownUntil(migrations, migrations.length, highestCommon).then(highestCommon => {
86
+ this.applyUpUntil(migrationsAvailable, Math.min(highestCommon, migrations.length), migrationsAvailable.length).then(callback, process.exit);
90
87
  }, process.exit);
91
88
  });
92
89
  }, () => process.exit(3));
@@ -175,4 +172,4 @@ END`)])).then(() => {
175
172
  });
176
173
  });
177
174
  }
178
- }
175
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "anote-server-libs",
3
- "version": "0.9.7",
3
+ "version": "0.9.8",
4
4
  "description": "Helpers for express-TS servers",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1",