Skip to content

Commit

Permalink
fix(getters): combine handling when only one element
Browse files Browse the repository at this point in the history
  • Loading branch information
anymaniax committed Mar 8, 2022
1 parent 48c39af commit 8e99ff9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/core/getters/combine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export const combineSchemas = async ({
` ${!isAllEnums ? SEPARATOR[separator] : '|'} `,
);

if (isAllEnums && name) {
if (isAllEnums && name && items.length > 1) {
const newEnum = `\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const ${pascal(
name,
)} = ${getCombineEnumValue(resolvedData, name)}`;
Expand All @@ -100,7 +100,7 @@ export const combineSchemas = async ({
value: value + nullable,
imports: resolvedData.imports,
schemas: resolvedData.schemas,
isEnum: isAllEnums,
isEnum: false,
type: 'object',
isRef: false,
};
Expand Down

1 comment on commit 8e99ff9

@vercel
Copy link

@vercel vercel bot commented on 8e99ff9 Mar 8, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.