MCPcopy Index your code
hub / github.com/processing/p5.js / descriptionStringForTypeScript

Function descriptionStringForTypeScript

utils/shared-helpers.mjs:57–80  ·  view source on GitHub ↗
(node, parent)

Source from the content-addressed store, hash-verified

55
56// TypeScript-specific version without HTML tags
57export function descriptionStringForTypeScript(node, parent) {
58 if (!node) {
59 return '';
60 } else if (node.type === 'text') {
61 return node.value;
62 } else if (node.type === 'paragraph') {
63 const content = node.children.map(n => descriptionStringForTypeScript(n, node)).join('');
64 return content + '\n\n'; // Skip HTML tags for TypeScript
65 } else if (node.type === 'code') {
66 return `\`${node.value}\``;
67 } else if (node.type === 'inlineCode') {
68 return `\`${node.value}\``;
69 } else if (node.type === 'list') {
70 return node.children.map(n => descriptionStringForTypeScript(n, node)).join('') + '\n';
71 } else if (node.type === 'listItem') {
72 return '- ' + node.children.map(n => descriptionStringForTypeScript(n, node)).join('') + '\n';
73 } else if (node.value) {
74 return node.value;
75 } else if (node.children) {
76 return node.children.map(n => descriptionStringForTypeScript(n, node)).join('');
77 } else {
78 return '';
79 }
80}
81
82export function typeObject(node) {
83 if (!node) return {};

Callers 2

generateTypedefInterfaceFunction · 0.90
typescript.mjsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected