(filePath: string)
| 562 | } |
| 563 | |
| 564 | function toRelativePath(filePath: string): string { |
| 565 | const cwd = process.cwd(); |
| 566 | const relativePath = path.relative(cwd, filePath); |
| 567 | if (relativePath === '' || (!relativePath.startsWith('..') && !path.isAbsolute(relativePath))) { |
| 568 | return relativePath === '' ? '.' : `.${path.sep}${relativePath}`; |
| 569 | } |
| 570 | return filePath; |
| 571 | } |
| 572 | |
| 573 | function toNumber(value: unknown): number { |
| 574 | return typeof value === 'number' && Number.isFinite(value) ? value : 0; |
no test coverage detected