(outputDir: string, from: string)
| 268 | // passed, i.e. aliases like `Accessor<T> = () => T` and inline `() => T`. |
| 269 | // Whether a type alias only changes how its single type argument is passed, e.g. `Accessor<T> = () => T`. |
| 270 | async function isWrapperAlias(outputDir: string, from: string) { |
| 271 | const code = (await readPage(outputDir, from))?.match( |
| 272 | /```ts\ntype \w+<(\w+)> = ([^\n]*);\n```/, |
| 273 | ) |
| 274 | return ( |
| 275 | !!code && |
| 276 | code[2]! |
| 277 | .split(' | ') |
| 278 | .every((member) => member === code[1] || member === `() => ${code[1]}`) |
| 279 | ) |
| 280 | } |
| 281 | |
| 282 | // The type page a `Parameters`/`Returns` type line refers to when the whole line is that one type |
| 283 | // (with an optional default value), looking through wrappers that only change how the value is |
no test coverage detected