@cornerstonejs/core
Version:
Cornerstone3D Core
13 lines (12 loc) • 427 B
JavaScript
import { MeshType } from '../../../enums/index.js';
export function validateMesh(meshData) {
if (!meshData.id) {
throw new Error('Mesh must have an id');
}
if (!meshData.arrayBuffer) {
throw new Error('Mesh must have an arrayBuffer');
}
if (!(meshData.format in MeshType)) {
throw new Error(`Mesh format must be one of the following: ${Object.values(MeshType).join(', ')}`);
}
}