All files / core/src/loaders/utils/surface validateSurface.ts

50% Statements 4/8
50% Branches 4/8
100% Functions 1/1
50% Lines 4/8

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 15 16 17 18 19 20      4x       4x       4x       4x        
import type { PublicSurfaceData } from '../../../types';
 
export function validateSurface(surfaceData: PublicSurfaceData): void {
  Iif (!surfaceData.id) {
    throw new Error('Surface must have an id');
  }
 
  Iif (surfaceData.points?.length === 0) {
    throw new Error('Surface must have non-empty points array');
  }
 
  Iif (surfaceData.polys?.length === 0) {
    throw new Error('Surface must have non-empty polys array');
  }
 
  Iif (!surfaceData.frameOfReferenceUID) {
    throw new Error('Surface must have a frameOfReferenceUID');
  }
}