MCPcopy Index your code
hub / github.com/callstack/agent-device / formatScreenshotDiffArtifactLines

Function formatScreenshotDiffArtifactLines

src/utils/output.ts:354–379  ·  view source on GitHub ↗
(
  data: ScreenshotDiffResult,
  match: boolean,
  useColor: boolean,
)

Source from the content-addressed store, hash-verified

352}
353
354function formatScreenshotDiffArtifactLines(
355 data: ScreenshotDiffResult,
356 match: boolean,
357 useColor: boolean,
358): string[] {
359 if (match) return [];
360
361 const lines: string[] = [];
362 if (data.diffPath) {
363 const relativePath = toRelativePath(data.diffPath);
364 const label = useColor ? colorize('Diff image:', 'dim') : 'Diff image:';
365 const displayPath = useColor ? colorize(relativePath, 'green') : relativePath;
366 lines.push(` ${label} ${displayPath}`);
367 }
368
369 if (data.currentOverlayPath) {
370 const relativePath = toRelativePath(data.currentOverlayPath);
371 const label = useColor ? colorize('Current overlay:', 'dim') : 'Current overlay:';
372 const displayPath = useColor ? colorize(relativePath, 'green') : relativePath;
373 const refCount = toNumber(data.currentOverlayRefCount);
374 const refSuffix = refCount > 0 ? ` (${refCount} refs)` : '';
375 lines.push(` ${label} ${displayPath}${refSuffix}`);
376 }
377
378 return lines;
379}
380
381function formatScreenshotDiffPixelCountLines(
382 data: ScreenshotDiffResult,

Callers 1

formatScreenshotDiffTextFunction · 0.85

Calls 4

toRelativePathFunction · 0.85
colorizeFunction · 0.85
toNumberFunction · 0.85
pushMethod · 0.80

Tested by

no test coverage detected