Skip to content

Commit

Permalink
fix: statically typed enum naming
Browse files Browse the repository at this point in the history
Co-authored-by: Micah Nagel <micah.nagel@defenseunicorns.com>
  • Loading branch information
UnicornChance and mjnagel authored Oct 18, 2024
1 parent 5c5dd16 commit 07e891d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/pepr/docs-gen/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,10 @@ function handleArray(
let type = "";
let markdown = "";

const capitalizedField = capitalizeFirstLetter(field);
if (schema.items?.enum) {
type = `Policy[] (enum):<ul>${schema.items.enum.map((value: string) => `<li><code>${value}</code></li>`).join("")}</ul>`;
type = `${capitalizedField}[] (enum):<ul>${schema.items.enum.map((value: string) => `<li><code>${value}</code></li>`).join("")}</ul>`;
} else if (schema.items?.properties) {
const capitalizedField = capitalizeFirstLetter(field);
type = `<a href="#${capitalizedField}">${capitalizedField}[]</a>`;
markdown = generateMarkdownFromSchema(schema.items.properties, field, currentDepth + 1);
} else if (schema.items?.type) {
Expand Down

0 comments on commit 07e891d

Please sign in to comment.