(outputDir: string, typeLine: string)
| 283 | // (with an optional default value), looking through wrappers that only change how the value is |
| 284 | // passed, i.e. aliases like `Accessor<T> = () => T` and inline `() => T`. |
| 285 | async function linkedTypePage(outputDir: string, typeLine: string) { |
| 286 | let line = typeLine |
| 287 | for (;;) { |
| 288 | line = line.replace(/^\(\) => /, '') |
| 289 | const link = line.match( |
| 290 | /^\[`\w+`\]\(\.\.\/((?:interfaces|type-aliases)\/\w+)\.md\)/, |
| 291 | ) |
| 292 | if (!link) { |
| 293 | return undefined |
| 294 | } |
| 295 | const { typeArguments, after } = splitTypeArguments( |
| 296 | line.slice(link[0].length), |
| 297 | ) |
| 298 | if (typeArguments && (await isWrapperAlias(outputDir, link[1]!))) { |
| 299 | line = typeArguments |
| 300 | continue |
| 301 | } |
| 302 | return after === '' || after.startsWith(' = ') ? link[1] : undefined |
| 303 | } |
| 304 | } |
| 305 | |
| 306 | // The name of the type a signature's code starts with, looking through the same wrappers. |
| 307 | async function typeNameInCode(outputDir: string, code: string) { |
no test coverage detected