@bian-womp/spark-graph 0.2.2 → 0.2.3
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 +6 -6
- package/lib/cjs/index.cjs.map +1 -1
- package/lib/esm/index.js +6 -6
- package/lib/esm/index.js.map +1 -1
- package/package.json +2 -2
package/lib/esm/index.js
CHANGED
|
@@ -2148,7 +2148,7 @@ function setupBasicGraphRegistry() {
|
|
|
2148
2148
|
});
|
|
2149
2149
|
// JSON parser node: base.stringToObject
|
|
2150
2150
|
registry.registerNode({
|
|
2151
|
-
id: "base.
|
|
2151
|
+
id: "base.string.toObject",
|
|
2152
2152
|
categoryId: "compute",
|
|
2153
2153
|
inputs: { Text: "base.string" },
|
|
2154
2154
|
outputs: { Object: "base.object" },
|
|
@@ -2164,7 +2164,7 @@ function setupBasicGraphRegistry() {
|
|
|
2164
2164
|
},
|
|
2165
2165
|
});
|
|
2166
2166
|
registry.registerNode({
|
|
2167
|
-
id: "base.
|
|
2167
|
+
id: "base.object.toString",
|
|
2168
2168
|
categoryId: "compute",
|
|
2169
2169
|
inputs: { Object: "base.object" },
|
|
2170
2170
|
outputs: { Text: "base.string" },
|
|
@@ -2254,7 +2254,7 @@ function setupBasicGraphRegistry() {
|
|
|
2254
2254
|
impl: (ins) => {
|
|
2255
2255
|
const a = asArray(ins.A ?? []);
|
|
2256
2256
|
const b = asArray(ins.B ?? []);
|
|
2257
|
-
const op = Number(ins.Operation ??
|
|
2257
|
+
const op = Number(ins.Operation ?? BaseMathOperation.Add);
|
|
2258
2258
|
const unaryByOp = {
|
|
2259
2259
|
[BaseMathOperation.Round]: (x) => Math.round(x),
|
|
2260
2260
|
[BaseMathOperation.Floor]: (x) => Math.floor(x),
|
|
@@ -2315,7 +2315,7 @@ function setupBasicGraphRegistry() {
|
|
|
2315
2315
|
outputs: { Result: "base.bool[]" },
|
|
2316
2316
|
impl: (ins) => {
|
|
2317
2317
|
const [a, b] = broadcast(ins.A, ins.B);
|
|
2318
|
-
const op = Number(ins.Operation ?? BaseCompareOperation.Equal)
|
|
2318
|
+
const op = Number(ins.Operation ?? BaseCompareOperation.Equal);
|
|
2319
2319
|
const compareByOp = {
|
|
2320
2320
|
[BaseCompareOperation.LessThan]: (x, y) => x < y,
|
|
2321
2321
|
[BaseCompareOperation.LessThanOrEqual]: (x, y) => x <= y,
|
|
@@ -2340,7 +2340,7 @@ function setupBasicGraphRegistry() {
|
|
|
2340
2340
|
outputs: { Result: "base.bool[]" },
|
|
2341
2341
|
inputDefaults: { Operation: BaseLogicOperation.Not },
|
|
2342
2342
|
impl: (ins) => {
|
|
2343
|
-
const op = Number(ins.Operation ?? BaseLogicOperation.Not)
|
|
2343
|
+
const op = Number(ins.Operation ?? BaseLogicOperation.Not);
|
|
2344
2344
|
if (op === BaseLogicOperation.Not) {
|
|
2345
2345
|
const a = asBoolArray(ins.A ?? []);
|
|
2346
2346
|
return { Result: a.map((x) => !x) };
|
|
@@ -3000,7 +3000,7 @@ function createValidationGraphDef() {
|
|
|
3000
3000
|
{ nodeId: "nA", typeId: "base.number" },
|
|
3001
3001
|
{ nodeId: "nB", typeId: "base.number" },
|
|
3002
3002
|
{ nodeId: "nC", typeId: "base.math" },
|
|
3003
|
-
{ nodeId: "s1", typeId: "base.
|
|
3003
|
+
{ nodeId: "s1", typeId: "base.object.toString" },
|
|
3004
3004
|
{ nodeId: "cmp", typeId: "base.compare" },
|
|
3005
3005
|
// Global validation issue: unknown node type (no nodeId/edgeId in data)
|
|
3006
3006
|
{ nodeId: "bad", typeId: "unknownType" },
|