(defaultRoot?: string)
| 386 | } |
| 387 | |
| 388 | function findDefaultRoot(defaultRoot?: string): string { |
| 389 | if (defaultRoot !== undefined) return defaultRoot; |
| 390 | const root = existsSync("docs") ? "docs" : "src"; |
| 391 | console.warn( |
| 392 | wrapAnsi( |
| 393 | `${yellow("Warning:")} the config file is missing the ${bold( |
| 394 | "root" |
| 395 | )} option, which specifies the path to the source root.${ |
| 396 | root === "docs" |
| 397 | ? ` The recommended source root is ${bold('"src"')}; however, since ${bold( |
| 398 | "docs" |
| 399 | )} exists and was previously the default for this option, we will use ${bold('"docs"')}.` |
| 400 | : "" |
| 401 | } You can suppress this warning by specifying ${bold(`root: ${JSON.stringify(root)}`)} in the config file.\n`, |
| 402 | Math.min(80, process.stdout.columns ?? 80) |
| 403 | ) |
| 404 | ); |
| 405 | return root; |
| 406 | } |
| 407 | |
| 408 | function normalizeArray<T>(spec: unknown, f: (spec: unknown) => T): T[] { |
| 409 | return spec == null ? [] : Array.from(spec as ArrayLike<unknown>, f); |
no test coverage detected