@bian-womp/spark-graph 0.3.21 → 0.3.23
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
|
@@ -5839,11 +5839,11 @@ function buildValueConverter(config) {
|
|
|
5839
5839
|
const { nodeId, handleId, value, type, nodeTypeId, handleDataType, runtimeTypeId, } = converterConfig;
|
|
5840
5840
|
const isTyped = isTypedOutput(value);
|
|
5841
5841
|
for (const mapping of config.mappings) {
|
|
5842
|
-
if (mapping.type !== type)
|
|
5842
|
+
if (mapping.type && mapping.type !== type)
|
|
5843
5843
|
continue;
|
|
5844
|
-
if (!matchesPattern(handleId, mapping.handleId))
|
|
5844
|
+
if (mapping.handleId && !matchesPattern(handleId, mapping.handleId))
|
|
5845
5845
|
continue;
|
|
5846
|
-
if (!matchesPattern(nodeId, mapping.nodeId))
|
|
5846
|
+
if (mapping.nodeId && !matchesPattern(nodeId, mapping.nodeId))
|
|
5847
5847
|
continue;
|
|
5848
5848
|
if (mapping.nodeTypeId && nodeTypeId) {
|
|
5849
5849
|
if (!matchesPattern(nodeTypeId, mapping.nodeTypeId))
|
|
@@ -5881,8 +5881,9 @@ function buildValueConverter(config) {
|
|
|
5881
5881
|
else {
|
|
5882
5882
|
if (typeof matchValue === "string" ||
|
|
5883
5883
|
typeof matchValue === "number") {
|
|
5884
|
-
|
|
5885
|
-
|
|
5884
|
+
const key = String(matchValue);
|
|
5885
|
+
if (key in mapping.valueMap) {
|
|
5886
|
+
newValue = mapping.valueMap[key];
|
|
5886
5887
|
changed = true;
|
|
5887
5888
|
}
|
|
5888
5889
|
}
|
|
@@ -5915,8 +5916,9 @@ function buildValueConverter(config) {
|
|
|
5915
5916
|
else {
|
|
5916
5917
|
if (typeof innerValue === "string" ||
|
|
5917
5918
|
typeof innerValue === "number") {
|
|
5918
|
-
|
|
5919
|
-
|
|
5919
|
+
const key = String(innerValue);
|
|
5920
|
+
if (key in mapping.valueMap) {
|
|
5921
|
+
newValue = mapping.valueMap[key];
|
|
5920
5922
|
// If mapped to null, return null to delete the output
|
|
5921
5923
|
if (newValue === null) {
|
|
5922
5924
|
return null;
|
|
@@ -5963,8 +5965,9 @@ function buildValueConverter(config) {
|
|
|
5963
5965
|
else {
|
|
5964
5966
|
if (typeof matchValue === "string" ||
|
|
5965
5967
|
typeof matchValue === "number") {
|
|
5966
|
-
|
|
5967
|
-
|
|
5968
|
+
const key = String(matchValue);
|
|
5969
|
+
if (key in mapping.valueMap) {
|
|
5970
|
+
newValue = mapping.valueMap[key];
|
|
5968
5971
|
changed = true;
|
|
5969
5972
|
}
|
|
5970
5973
|
}
|
|
@@ -5986,8 +5989,9 @@ function buildValueConverter(config) {
|
|
|
5986
5989
|
}
|
|
5987
5990
|
else {
|
|
5988
5991
|
if (typeof value === "string" || typeof value === "number") {
|
|
5989
|
-
|
|
5990
|
-
|
|
5992
|
+
const key = String(value);
|
|
5993
|
+
if (key in mapping.valueMap) {
|
|
5994
|
+
return mapping.valueMap[key];
|
|
5991
5995
|
}
|
|
5992
5996
|
}
|
|
5993
5997
|
}
|