Skip to content

Commit ec6519c

Browse files
committed
refactor: use the actual type
1 parent 0742d09 commit ec6519c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/platform/workflow/validation/schemas/workflowSchema.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
import { z } from 'zod'
22
import type { SafeParseReturnType } from 'zod'
33
import { fromZodError } from 'zod-validation-error'
4+
import type { RendererType } from '@/lib/litegraph/src/LGraph'
5+
6+
const zRendererType = z.enum(['LG', 'Vue']) satisfies z.ZodType<RendererType>
47

58
// GroupNode is hacking node id to be a string, so we need to allow that.
69
// innerNode.id = `${this.node.id}:${i}`
@@ -272,7 +275,7 @@ const zExtra = z
272275
frontendVersion: z.string().optional(),
273276
linkExtensions: z.array(zComfyLinkExtension).optional(),
274277
reroutes: z.array(zReroute).optional(),
275-
workflowRendererVersion: z.enum(['LG', 'Vue']).optional()
278+
workflowRendererVersion: zRendererType.optional()
276279
})
277280
.passthrough()
278281

0 commit comments

Comments
 (0)