MCPcopy Index your code
hub / github.com/codeceptjs/CodeceptJS / sanitizeTextContent

Function sanitizeTextContent

lib/html.js:223–237  ·  view source on GitHub ↗
(node)

Source from the content-addressed store, hash-verified

221}
222
223function sanitizeTextContent(node) {
224 if (node.nodeName === '#text') {
225 return node.value.trim()
226 }
227
228 let sanitizedText = ''
229
230 if (node.childNodes) {
231 for (const childNode of node.childNodes) {
232 sanitizedText += sanitizeTextContent(childNode)
233 }
234 }
235
236 return sanitizedText
237}
238
239function buildPath(node, path = '') {
240 const tag = node.nodeName

Callers 1

scanErrorsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected