Skip to content

Commit 8bd1690

Browse files
committed
chore: display values only if enum values exist else show default set
1 parent e785b99 commit 8bd1690

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

apps/web/src/features/upload/utils.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -342,12 +342,13 @@ function generateSampleData({
342342
return formatTypeInfo('number', isOptional);
343343
case 'ZodSet':
344344
try {
345-
if (!enumValues) {
346-
throw new Error('Missing enumValues for ZodSet');
345+
if (enumValues) {
346+
const enumString = enumValues.join('/');
347+
const possibleEnumOutputs = `SET(${enumString}, ...)`;
348+
return formatTypeInfo(possibleEnumOutputs, isOptional);
347349
}
348-
const enumString = enumValues.join('/');
349-
const possibleEnumOutputs = `SET(${enumString}, ...)`;
350-
return formatTypeInfo(possibleEnumOutputs, isOptional);
350+
351+
return formatTypeInfo('SET(a,b,c)', isOptional);
351352
} catch {
352353
throw new Error(`Failed to generate sample data for ZodSet`);
353354
}

0 commit comments

Comments
 (0)