Skip to content
This repository has been archived by the owner on Nov 16, 2023. It is now read-only.

Commit

Permalink
feat: render descriptions for args
Browse files Browse the repository at this point in the history
  • Loading branch information
phuctm97 committed Feb 16, 2022
1 parent b7b8f17 commit 992f2ce
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion utils/parser.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { sentenceCase } from "sentence-case";

export interface SimpleToken {
indices: [number, number]; // [start, end], end is exclusive
value: string;
Expand Down Expand Up @@ -124,7 +126,9 @@ export function parseToSpecTokens(
specTokens.push({
...token,
type: "argument",
description: arg.description,
description:
arg.description ||
(arg.name ? sentenceCase(arg.name) : undefined),
});
if (!arg.isVariadic) {
if (
Expand Down

1 comment on commit 992f2ce

@vercel
Copy link

@vercel vercel bot commented on 992f2ce Feb 16, 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.