We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 26b1ac7 commit 013d7eeCopy full SHA for 013d7ee
src/parser.ts
@@ -22,8 +22,8 @@ export interface Data {
22
23
function getComment(element: Element): string {
24
// @ts-ignore
25
- const prev = element.siblings[element.siblings.indexOf(element) - 1] as Element
26
- if (prev.type === COMMENT) {
+ const prev = element.siblings[element.siblings.indexOf(element) - 1] as Element | undefined
+ if (prev?.type === COMMENT) {
27
return (prev.children as string).trim()
28
}
29
return ''
0 commit comments