mythix 2.11.2 → 2.11.4

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mythix",
3
- "version": "2.11.2",
3
+ "version": "2.11.4",
4
4
  "description": "Mythix is a NodeJS web-app framework",
5
5
  "main": "src/index",
6
6
  "scripts": {
@@ -23,7 +23,7 @@
23
23
  "@types/node": "^18.11.9",
24
24
  "colors": "^1.4.0",
25
25
  "diff": "^5.1.0",
26
- "eslint": "^8.27.0",
26
+ "eslint": "^8.28.0",
27
27
  "jasmine": "^4.5.0"
28
28
  },
29
29
  "dependencies": {
@@ -35,7 +35,7 @@
35
35
  "form-data": "^4.0.0",
36
36
  "luxon": "^3.1.0",
37
37
  "micromatch": "^4.0.5",
38
- "mythix-orm": "^1.11.0",
38
+ "mythix-orm": "^1.11.6",
39
39
  "nife": "^1.12.1",
40
40
  "prompts": "^2.4.2"
41
41
  }
@@ -62,16 +62,16 @@ module.exports = defineCommand('migrate', ({ Parent }) => {
62
62
  let fileName = Path.basename(fullFileName);
63
63
  let migrationFileTS = fileName.substring(0, TIMESTAMP_LENGTH);
64
64
 
65
- if (BigInt(migrationFileTS) >= revision)
65
+ if (BigInt(migrationFileTS) > revision)
66
66
  return true;
67
67
 
68
68
  return false;
69
69
  });
70
70
 
71
71
  if (index < 0)
72
- return migrationFiles.slice();
72
+ return [];
73
73
 
74
- return migrationFiles.slice((isRollback) ? index : index + 1);
74
+ return migrationFiles.slice((isRollback) ? index - 1 : index);
75
75
  }
76
76
 
77
77
  async executeMigration(application, dbConnection, migrationFileName, useTransaction, rollback) {
@@ -126,16 +126,12 @@ class TaskModule extends BaseModule {
126
126
  promise.reject(error);
127
127
  };
128
128
 
129
- const _runTask = () => {
130
- let result = taskInstance.execute(lastTime, currentTime, diff);
131
-
132
- if (Nife.instanceOf(result, 'promise')) {
133
- result.then(
134
- successResult,
135
- errorResult,
136
- );
137
- } else {
138
- promise.resolve(result);
129
+ const _runTask = async () => {
130
+ try {
131
+ let result = await taskInstance.execute(lastTime, currentTime, diff);
132
+ successResult(result);
133
+ } catch (error) {
134
+ errorResult(error);
139
135
  }
140
136
  };
141
137