(item: SSRBufferItem)
| 131 | const commentTestRE = /^<!--[\s\S]*-->$/ |
| 132 | const commentRE = /<!--[^]*?-->/gm |
| 133 | function isComment(item: SSRBufferItem) { |
| 134 | if (typeof item !== 'string' || !commentTestRE.test(item)) return false |
| 135 | // if item is '<!---->' or '<!--[-->' or '<!--]-->', return true directly |
| 136 | if (item.length <= 8) return true |
| 137 | return !item.replace(commentRE, '').trim() |
| 138 | } |
no test coverage detected