MCPcopy Create free account
hub / github.com/callstack/agent-device / formatScreenshotRegionDetails

Function formatScreenshotRegionDetails

src/utils/output.ts:549–562  ·  view source on GitHub ↗
(region: ScreenshotDiffRegion)

Source from the content-addressed store, hash-verified

547}
548
549function 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
564function toRelativePath(filePath: string): string {
565 const cwd = process.cwd();

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…