(node, parent)
| 55 | |
| 56 | // TypeScript-specific version without HTML tags |
| 57 | export 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 | |
| 82 | export function typeObject(node) { |
| 83 | if (!node) return {}; |
no outgoing calls
no test coverage detected