All files bodyStore.ts

100% Statements 5/5
100% Branches 4/4
100% Functions 1/1
100% Lines 4/4

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 132x             8x   7x 7x    
const fileBodyReference = /^filebody:v1:([0-9a-f]{32})$/;
 
/**
 * Returns the path relative to a FileBodyStore root for a recognized opaque
 * reference. Absolute store roots intentionally never enter HAR evidence.
 */
export function fileBodyAssetPath(reference: string | undefined): string | undefined {
  if (!reference) return undefined;
 
  const match = fileBodyReference.exec(reference);
  return match ? `assets/${match[1]}.body` : undefined;
}