From 2c49a423e25516d3ec69752764c87acfd13bafaa Mon Sep 17 00:00:00 2001 From: Alexander Rose <alexander.rose@weirdbyte.de> Date: Thu, 21 Apr 2022 19:47:13 -0700 Subject: [PATCH] type assertion --- src/mol-plugin-state/helpers/root-structure.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/mol-plugin-state/helpers/root-structure.ts b/src/mol-plugin-state/helpers/root-structure.ts index 56ae7621c..12bb254cf 100644 --- a/src/mol-plugin-state/helpers/root-structure.ts +++ b/src/mol-plugin-state/helpers/root-structure.ts @@ -15,6 +15,7 @@ import { PluginContext } from '../../mol-plugin/context'; import { Assembly, Symmetry } from '../../mol-model/structure/model/properties/symmetry'; import { PluginStateObject as SO } from '../objects'; import { ModelSymmetry } from '../../mol-model-formats/structure/property/symmetry'; +import { assertUnreachable } from '../../mol-util/type-helpers'; const CommonStructureParams = { dynamicBonds: PD.Optional(PD.Boolean(false, { description: 'Ensure bonds are recalculated upon model changes. Also enables calculation of inter-unit bonds in water molecules and ions.' })), @@ -188,6 +189,6 @@ export namespace RootStructureDefinition { return buildSymmetryAssembly(ctx, model, params.params.generators, symmetry, props); } - throw new Error(`Unknown represetation type: ${(params as any).name}`); + assertUnreachable(params); } } \ No newline at end of file -- GitLab