@bian-womp/spark-graph 0.1.17 → 0.1.18
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/cjs/index.cjs
CHANGED
|
@@ -1893,6 +1893,23 @@ function setupBasicGraphRegistry() {
|
|
|
1893
1893
|
Result: Math.trunc(Number(ins.Value)),
|
|
1894
1894
|
}),
|
|
1895
1895
|
});
|
|
1896
|
+
// JSON parser node: base.stringToObject
|
|
1897
|
+
registry.registerNode({
|
|
1898
|
+
id: "base.stringToObject",
|
|
1899
|
+
categoryId: "compute",
|
|
1900
|
+
inputs: { Text: "base.string" },
|
|
1901
|
+
outputs: { Object: "base.object" },
|
|
1902
|
+
impl: (ins) => {
|
|
1903
|
+
const t = ins.Text ?? "";
|
|
1904
|
+
try {
|
|
1905
|
+
const obj = JSON.parse(t);
|
|
1906
|
+
return { Object: obj };
|
|
1907
|
+
}
|
|
1908
|
+
catch {
|
|
1909
|
+
return { Object: undefined };
|
|
1910
|
+
}
|
|
1911
|
+
},
|
|
1912
|
+
});
|
|
1896
1913
|
// Number to String
|
|
1897
1914
|
registry.registerNode({
|
|
1898
1915
|
id: "base.numberToString",
|