MCPcopy Create free account
hub / github.com/caseywebdev/react-list / describeTextNode

Function describeTextNode

docs/index.js:20530–20543  ·  view source on GitHub ↗
(content, maxLength)

Source from the content-addressed store, hash-verified

20528 }
20529 }
20530 function describeTextNode(content, maxLength) {
20531 return needsEscaping.test(content)
20532 ? ((content = JSON.stringify(content)),
20533 content.length > maxLength - 2
20534 ? 8 > maxLength
20535 ? '{"..."}'
20536 : "{" + content.slice(0, maxLength - 7) + '..."}'
20537 : "{" + content + "}")
20538 : content.length > maxLength
20539 ? 5 > maxLength
20540 ? '{"..."}'
20541 : content.slice(0, maxLength - 3) + "..."
20542 : content;
20543 }
20544 function describeTextDiff(clientText, serverProps, indent) {
20545 var maxLength = 120 - 2 * indent;
20546 if (null === serverProps)

Callers 2

describeTextDiffFunction · 0.85
describeNodeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…