graphai 1.0.13 → 1.0.14
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/lib/bundle.cjs.js +1 -1
- package/lib/bundle.cjs.js.map +1 -1
- package/lib/bundle.esm.js +135 -129
- package/lib/bundle.esm.js.map +1 -1
- package/lib/bundle.umd.js +1 -1
- package/lib/bundle.umd.js.map +1 -1
- package/lib/graphai.d.ts +1 -1
- package/lib/graphai.js +4 -4
- package/lib/utils/result.js +2 -1
- package/lib/utils/utils.d.ts +2 -1
- package/lib/utils/utils.js +13 -7
- package/package.json +1 -1
package/lib/utils/utils.js
CHANGED
|
@@ -4,11 +4,12 @@ exports.loopCounterKey = exports.isStaticNodeData = exports.isComputedNodeData =
|
|
|
4
4
|
exports.assert = assert;
|
|
5
5
|
const type_1 = require("../type");
|
|
6
6
|
const GraphAILogger_1 = require("./GraphAILogger");
|
|
7
|
+
const prop_function_1 = require("./prop_function");
|
|
7
8
|
const sleep = async (milliseconds) => {
|
|
8
9
|
return await new Promise((resolve) => setTimeout(resolve, milliseconds));
|
|
9
10
|
};
|
|
10
11
|
exports.sleep = sleep;
|
|
11
|
-
const parseNodeName = (inputNodeId, isSelfNode = false) => {
|
|
12
|
+
const parseNodeName = (inputNodeId, isSelfNode = false, nodes) => {
|
|
12
13
|
if (isSelfNode) {
|
|
13
14
|
if (typeof inputNodeId === "string" && inputNodeId[0] === ".") {
|
|
14
15
|
const parts = inputNodeId.split(".");
|
|
@@ -19,14 +20,19 @@ const parseNodeName = (inputNodeId, isSelfNode = false) => {
|
|
|
19
20
|
if (typeof inputNodeId === "string") {
|
|
20
21
|
const regex = /^:(.*)$/;
|
|
21
22
|
const match = inputNodeId.match(regex);
|
|
22
|
-
if (
|
|
23
|
-
|
|
23
|
+
if (match) {
|
|
24
|
+
const parts = match[1].split(/(?<!\()\.(?!\))/);
|
|
25
|
+
if (parts.length == 1) {
|
|
26
|
+
return { nodeId: parts[0] };
|
|
27
|
+
}
|
|
28
|
+
return { nodeId: parts[0], propIds: parts.slice(1) };
|
|
24
29
|
}
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
|
|
30
|
+
const regexUtil = /^@(.*)$/;
|
|
31
|
+
const matchUtil = inputNodeId.match(regexUtil);
|
|
32
|
+
// Only when just called from resultsOfInner
|
|
33
|
+
if (nodes && matchUtil) {
|
|
34
|
+
return { value: (0, prop_function_1.utilsFunctions)(inputNodeId, nodes) };
|
|
28
35
|
}
|
|
29
|
-
return { nodeId: parts[0], propIds: parts.slice(1) };
|
|
30
36
|
}
|
|
31
37
|
return { value: inputNodeId }; // non-string literal
|
|
32
38
|
};
|