All files / core/src/utilities getVolumeViewReferenceId.ts

100% Statements 5/5
50% Branches 1/2
100% Functions 2/2
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 13 14              292x 292x 876x   292x    
import type { Point3 } from '../types';
 
export default function getVolumeViewReferenceId(args: {
  sliceIndex: number;
  viewPlaneNormal: Point3;
  volumeId: string;
}): string {
  const { sliceIndex, viewPlaneNormal, volumeId } = args;
  const querySeparator = volumeId.includes('?') ? '&' : '?';
  const formattedNormal = viewPlaneNormal.map((value) => value.toFixed(3));
 
  return `volumeId:${volumeId}${querySeparator}sliceIndex=${sliceIndex}&viewPlaneNormal=${formattedNormal.join(',')}`;
}