MCPcopy Create free account
hub / github.com/editablejs/editable / transform

Function transform

packages/serializer/src/text.ts:23–32  ·  view source on GitHub ↗
(node: Node)

Source from the content-addressed store, hash-verified

21
22export const TextSerializer = {
23 transform(node: Node): string {
24 if (Text.isText(node)) return escapeHtml(node.text)
25 const { children } = node
26 return children
27 .map(children => {
28 const text = this.transform(children)
29 return Editor.isEditor(node) ? text + '\n' : text
30 })
31 .join('')
32 },
33
34 with<T = TextSerializerOptions>(transform: TextSerializerWithTransform<T>, options: T) {
35 const { transform: t } = this

Callers 2

withFunction · 0.70
getStaticPropsFunction · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…