import { ProtocolFile } from '@opentrons/shared-data' ; export function getLabwareDefinitionUri ( labwareId , labware ? ) { const labwareDefinitionId = labware ?. [ labwareId ] . definitionId ; if ( labwareDefinitionId == null ) { throw new Error ( 'expected to be able to find labware definition id for labware, but could not' ) ; } const ID_POSTFIX_LENGTH = 3 ; return labwareDefinitionId . substring ( 0 , labwareDefinitionId . length - ID_POSTFIX_LENGTH ) ; }