MCPcopy
hub / github.com/vuejs/core / isComment

Function isComment

packages/server-renderer/src/helpers/ssrRenderSlot.ts:133–138  ·  view source on GitHub ↗
(item: SSRBufferItem)

Source from the content-addressed store, hash-verified

131const commentTestRE = /^<!--[\s\S]*-->$/
132const commentRE = /<!--[^]*?-->/gm
133function 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}

Callers 1

ssrRenderSlotInnerFunction · 0.70

Calls 1

testMethod · 0.80

Tested by

no test coverage detected