(region: ScreenshotDiffRegion)
| 547 | } |
| 548 | |
| 549 | function formatScreenshotRegionDetails(region: ScreenshotDiffRegion): string | null { |
| 550 | const details = [ |
| 551 | region.size ? `size=${region.size}` : null, |
| 552 | region.shape ? `shape=${region.shape}` : null, |
| 553 | typeof region.densityPercentage === 'number' ? `density=${region.densityPercentage}%` : null, |
| 554 | region.averageBaselineColorHex && region.averageCurrentColorHex |
| 555 | ? `avgColor=${region.averageBaselineColorHex}->${region.averageCurrentColorHex}` |
| 556 | : null, |
| 557 | typeof region.baselineLuminance === 'number' && typeof region.currentLuminance === 'number' |
| 558 | ? `luminance=${region.baselineLuminance}->${region.currentLuminance}` |
| 559 | : null, |
| 560 | ].filter((entry): entry is string => entry !== null); |
| 561 | return details.length > 0 ? details.join(' ') : null; |
| 562 | } |
| 563 | |
| 564 | function toRelativePath(filePath: string): string { |
| 565 | const cwd = process.cwd(); |
no outgoing calls
no test coverage detected
searching dependent graphs…