mirror of
https://github.com/langgenius/dify.git
synced 2026-08-27 03:01:54 -04:00
7aba539e82
Co-authored-by: zhangx1n <zhangxin@dify.ai> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
15 lines
390 B
TypeScript
15 lines
390 B
TypeScript
export type WorkflowVersionNameSource = {
|
|
marked_name?: string | null
|
|
version_number?: number | null
|
|
}
|
|
|
|
export const getWorkflowVersionName = (
|
|
version: WorkflowVersionNameSource | null | undefined,
|
|
defaultName: string,
|
|
): string => {
|
|
if (version?.marked_name) return version.marked_name
|
|
if (version?.version_number) return `# ${version.version_number}`
|
|
|
|
return defaultName
|
|
}
|