Skip to content

Commit 78e9165

Browse files
committed
feat(jsdocs): upper-first headings
1 parent 8f30476 commit 78e9165

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
"citty": "^0.1.5",
3737
"consola": "^3.2.3",
3838
"magic-string": "^0.30.7",
39+
"scule": "^1.2.0",
3940
"untyped": "^1.4.2"
4041
},
4142
"devDependencies": {

pnpm-lock.yaml

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/generators/jsdocs.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { resolve } from "node:path";
22
import { loadSchema } from "untyped/loader";
33
import type { Schema } from "untyped";
4+
import { upperFirst } from "scule";
45
import { defineGenerator } from "../generator";
56

67
export default defineGenerator({
@@ -78,7 +79,7 @@ function renderSchema(schema: Schema, opts: { headingLevel: number }) {
7879
return a.localeCompare(b);
7980
})) {
8081
if (group) {
81-
lines.push(`${"#".repeat(opts.headingLevel)} ${group}`, "");
82+
lines.push(`${"#".repeat(opts.headingLevel)} ${upperFirst(group)}`, "");
8283
}
8384
for (const item of sections[group].sort((i1, i2) =>
8485
i1[0].localeCompare(i2[0]),

0 commit comments

Comments
 (0)