sanger/limber

View on GitHub
app/frontend/javascript/shared/tubeHelpers.js

Summary

Maintainability
A
35 mins
Test Coverage
import buildArray from './buildArray.js'

const buildTubeObjs = function (number) {
  return buildArray(number, (iteration) => {
    return { state: 'empty', labware: null, index: iteration }
  })
}

const purposeConfigForTube = function (tube, purposeConfigs) {
  const purposeUuid = tube?.purpose?.uuid
  return purposeConfigs ? purposeConfigs[purposeUuid] : undefined
}

export { buildTubeObjs, purposeConfigForTube }