@hahnpro/flow-sdk 2025.2.0-beta.2 → 2025.10.0
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 +1 -2
- package/src/lib/FlowApplication.js +2 -1
- package/src/lib/index.d.ts +0 -1
- package/src/lib/index.js +0 -1
- package/src/lib/unit-utils.js +6 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hahnpro/flow-sdk",
|
|
3
|
-
"version": "2025.
|
|
3
|
+
"version": "2025.10.0",
|
|
4
4
|
"description": "SDK for building Flow Modules",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": {
|
|
@@ -17,7 +17,6 @@
|
|
|
17
17
|
"access": "public"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@hahnpro/hpc-api": "2025.6.0",
|
|
21
20
|
"@nats-io/jetstream": "3.2.0",
|
|
22
21
|
"@nats-io/nats-core": "3.2.0",
|
|
23
22
|
"@nats-io/transport-node": "3.2.0",
|
|
@@ -285,8 +285,9 @@ class FlowApplication {
|
|
|
285
285
|
}
|
|
286
286
|
}
|
|
287
287
|
async init() {
|
|
288
|
-
if (this.initialized)
|
|
288
|
+
if (this.initialized) {
|
|
289
289
|
return;
|
|
290
|
+
}
|
|
290
291
|
this.context = { ...this.flow.context };
|
|
291
292
|
this.contextManager.overwriteAllProperties(this.flow.properties ?? {});
|
|
292
293
|
try {
|
package/src/lib/index.d.ts
CHANGED
package/src/lib/index.js
CHANGED
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.IncompatableWith = exports.FlowModule = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
tslib_1.__exportStar(require("@hahnpro/hpc-api"), exports);
|
|
6
5
|
tslib_1.__exportStar(require("./flow.interface"), exports);
|
|
7
6
|
tslib_1.__exportStar(require("./utils"), exports);
|
|
8
7
|
tslib_1.__exportStar(require("./FlowApplication"), exports);
|
package/src/lib/unit-utils.js
CHANGED
|
@@ -56,8 +56,9 @@ const prefixes = [
|
|
|
56
56
|
{ prefix: 'y', convfactor: 1e-24 },
|
|
57
57
|
];
|
|
58
58
|
function verifyUnit(unit, metric) {
|
|
59
|
-
if (unit === '' || metric === '')
|
|
59
|
+
if (unit === '' || metric === '') {
|
|
60
60
|
return -1;
|
|
61
|
+
}
|
|
61
62
|
const definition = units_1.units[metric];
|
|
62
63
|
for (const dimension of definition.dimensions) {
|
|
63
64
|
const components = dimension.split('*');
|
|
@@ -74,8 +75,9 @@ function verifyUnit(unit, metric) {
|
|
|
74
75
|
return -1;
|
|
75
76
|
}
|
|
76
77
|
function verifyIndices(indices, unit) {
|
|
77
|
-
if (indices.length === 0 || !unit)
|
|
78
|
+
if (indices.length === 0 || !unit) {
|
|
78
79
|
return 1;
|
|
80
|
+
}
|
|
79
81
|
const filtered = indices
|
|
80
82
|
.map((arr) => arr.filter((v) => v.index !== -1))
|
|
81
83
|
.reduce((previousValue, currentValue) => {
|
|
@@ -97,8 +99,9 @@ function verifyIndices(indices, unit) {
|
|
|
97
99
|
let convfactor = 1;
|
|
98
100
|
while (index != unit.length) {
|
|
99
101
|
const find = filteredElement.find((obj) => obj?.index === index);
|
|
100
|
-
if (!find)
|
|
102
|
+
if (!find) {
|
|
101
103
|
continue outer;
|
|
104
|
+
}
|
|
102
105
|
index += find.length;
|
|
103
106
|
convfactor *= find.convfactor;
|
|
104
107
|
}
|