| 215 | // typesDescription is used as fallback when types contains '[object Object]' |
| 216 | // (happens with string literal types like 'before'|'after' due to dox/jsdoctypeparser bug) |
| 217 | function convertTypesToString(types, typesDescription) { |
| 218 | if (!Array.isArray(types)) { |
| 219 | return types; |
| 220 | } |
| 221 | const result = types.join('|'); |
| 222 | if (result.includes('[object Object]') && typesDescription) { |
| 223 | // Strip HTML code tags from typesDescription: <code>foo</code> -> foo |
| 224 | return typesDescription.replace(/<\/?code>/g, ''); |
| 225 | } |
| 226 | return result; |
| 227 | } |
| 228 | |
| 229 | /** |
| 230 | * Convert API doc HTML links in a string to their equivalent Markdown file paths. |