Skip to content

Commit

Permalink
fix: make sure leading comments has value before assigning
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Jan 19, 2024
1 parent 4683cae commit 7a94141
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/loader/babel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const babelPluginUntyped: PluginItem = function (
}
},
ObjectProperty(p) {
if (p.node.leadingComments) {
if (p.node.leadingComments && p.node.leadingComments.length > 0) {
const schema = parseJSDocs(
p.node.leadingComments
.filter((c) => c.type === "CommentBlock")
Expand Down
2 changes: 1 addition & 1 deletion test/loader.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ describe("loader", () => {
"description": "",
"id": "#config/checked",
"tags": [],
"title": "",
"title": "checked status",
"type": "boolean",
},
},
Expand Down

0 comments on commit 7a94141

Please sign in to comment.