Skip to content

Commit 7a94141

Browse files
committed
fix: make sure leading comments has value before assigning
1 parent 4683cae commit 7a94141

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/loader/babel.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ const babelPluginUntyped: PluginItem = function (
3939
}
4040
},
4141
ObjectProperty(p) {
42-
if (p.node.leadingComments) {
42+
if (p.node.leadingComments && p.node.leadingComments.length > 0) {
4343
const schema = parseJSDocs(
4444
p.node.leadingComments
4545
.filter((c) => c.type === "CommentBlock")

test/loader.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ describe("loader", () => {
2525
"description": "",
2626
"id": "#config/checked",
2727
"tags": [],
28-
"title": "",
28+
"title": "checked status",
2929
"type": "boolean",
3030
},
3131
},

0 commit comments

Comments
 (0)