feat/debug-node #41
@@ -29,8 +29,9 @@ function areSocketsCompatible(
|
|||||||
output: string | undefined,
|
output: string | undefined,
|
||||||
inputs: string | (string | undefined)[] | undefined
|
inputs: string | (string | undefined)[] | undefined
|
||||||
) {
|
) {
|
||||||
|
if (output === '*') return true;
|
||||||
if (Array.isArray(inputs) && output) {
|
if (Array.isArray(inputs) && output) {
|
||||||
return inputs.includes(output);
|
return inputs.includes('*') || inputs.includes(output);
|
||||||
}
|
}
|
||||||
return inputs === output;
|
return inputs === output;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -89,6 +89,11 @@ export const NodeInputPathSchema = z.object({
|
|||||||
value: z.array(z.number()).optional()
|
value: z.array(z.number()).optional()
|
||||||
});
|
});
|
||||||
|
|
||||||
|
export const NodeInputAnySchema = z.object({
|
||||||
|
...DefaultOptionsSchema.shape,
|
||||||
|
type: z.literal('*')
|
||||||
|
});
|
||||||
|
|
||||||
export const NodeInputSchema = z.union([
|
export const NodeInputSchema = z.union([
|
||||||
NodeInputSeedSchema,
|
NodeInputSeedSchema,
|
||||||
NodeInputBooleanSchema,
|
NodeInputBooleanSchema,
|
||||||
@@ -100,7 +105,8 @@ export const NodeInputSchema = z.union([
|
|||||||
NodeInputSeedSchema,
|
NodeInputSeedSchema,
|
||||||
NodeInputVec3Schema,
|
NodeInputVec3Schema,
|
||||||
NodeInputGeometrySchema,
|
NodeInputGeometrySchema,
|
||||||
NodeInputPathSchema
|
NodeInputPathSchema,
|
||||||
|
NodeInputAnySchema
|
||||||
]);
|
]);
|
||||||
|
|
||||||
export type NodeInput = z.infer<typeof NodeInputSchema>;
|
export type NodeInput = z.infer<typeof NodeInputSchema>;
|
||||||
|
|||||||
Reference in New Issue
Block a user