fix: deal with undefined valueType (#6684)

* fix: deal with undefined valueType

* fix

* fix

* fix key
This commit is contained in:
gaga0714
2026-03-31 16:56:32 +08:00
committed by GitHub
parent b884631363
commit c5371ae886
4 changed files with 20 additions and 9 deletions
@@ -232,6 +232,16 @@ export const FlowValueTypeMap: Record<
}
};
export const getFlowValueTypeMeta = (
valueType?: WorkflowIOValueTypeEnum | string | null
): (typeof FlowValueTypeMap)[WorkflowIOValueTypeEnum] => {
if (valueType == null || valueType === '') {
return FlowValueTypeMap[WorkflowIOValueTypeEnum.any];
}
const meta = FlowValueTypeMap[valueType as WorkflowIOValueTypeEnum];
return meta ?? FlowValueTypeMap[WorkflowIOValueTypeEnum.any];
};
export const EDGE_TYPE = 'default';
export const chatHistoryValueDesc = `{