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

Function stringifyNodeOnServer

apps/docs/src/pages/[[...markdownPath]].js:180–188  ·  view source on GitHub ↗
(key, val)

Source from the content-addressed store, hash-verified

178
179 // Serialize a server React tree node to JSON.
180 function stringifyNodeOnServer(key, val) {
181 if (val != null && val.$$typeof === Symbol.for('react.element')) {
182 // Remove fake MDX props.
183 const { mdxType, originalType, parentName, ...cleanProps } = val.props
184 return ['$r', typeof val.type === 'string' ? val.type : mdxType, val.key, cleanProps]
185 } else {
186 return val
187 }
188 }
189
190 // Cache it on the disk.
191 await store.set(hash, output)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…