MCPcopy Create free account
hub / github.com/adobe/react-spectrum / toText

Function toText

packages/dev/s2-docs/scripts/generateAgentSkills.mjs:257–271  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

255 const tree = unified().use(remarkParse).parse(content);
256
257 const toText = node => {
258 if (!node) {
259 return '';
260 }
261 if (node.type === 'text') {
262 return node.value;
263 }
264 if (node.type === 'inlineCode') {
265 return '`' + node.value + '`';
266 }
267 if (Array.isArray(node.children)) {
268 return node.children.map(toText).join('');
269 }
270 return '';
271 };
272
273 const extractEntry = listItem => {
274 const paragraph = listItem.children?.find(child => child.type === 'paragraph');

Callers 1

extractEntryFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected