Skip to content

Commit

Permalink
chore: limit enum splaying (#2039)
Browse files Browse the repository at this point in the history
  • Loading branch information
RohinBhargava authored Jan 21, 2025
1 parent 530833a commit 4f8c634
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions packages/fern-docs/ui/src/type-shorthand/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -218,13 +218,7 @@ export function renderTypeShorthand(
},
discriminatedUnion: () =>
plural ? "objects" : maybeWithArticle("an", "object"),
enum: (enumValue) => {
// if there are only 1 or 2 values, we can list them like literals (e.g. "apple" or "banana")
if (enumValue.values.length > 0 && enumValue.values.length < 3) {
return enumValue.values
.map((value) => `"${value.value}"`)
.join(" or ");
}
enum: () => {
return plural ? "enums" : maybeWithArticle("an", "enum");
},

Expand Down

0 comments on commit 4f8c634

Please sign in to comment.