(url: string, root: string)
| 376 | * pretty url for logging. |
| 377 | */ |
| 378 | export function prettifyUrl(url: string, root: string): string { |
| 379 | url = removeTimestampQuery(url) |
| 380 | const isAbsoluteFile = url.startsWith(root) |
| 381 | if (isAbsoluteFile || url.startsWith(FS_PREFIX)) { |
| 382 | const file = path.posix.relative( |
| 383 | root, |
| 384 | isAbsoluteFile ? url : fsPathFromId(url), |
| 385 | ) |
| 386 | return colors.dim(file) |
| 387 | } else { |
| 388 | return colors.dim(url) |
| 389 | } |
| 390 | } |
| 391 | |
| 392 | export function isObject(value: unknown): value is Record<string, any> { |
| 393 | return Object.prototype.toString.call(value) === class="st">'[object Object]' |
no test coverage detected