MCPcopy Create free account
hub / github.com/codecombat/codecombat / getCurrentModuleNames

Function getCurrentModuleNames

ozaria/site/store/BaseCurriculumGuide.js:75–85  ·  view source on GitHub ↗
(_state, getters, _rootState, _rootGetters)

Source from the content-addressed store, hash-verified

73 },
74
75 getCurrentModuleNames (_state, getters, _rootState, _rootGetters) {
76 return moduleNum => {
77 const course = getters.getCurrentCourse
78 let moduleInfo = Object.values(course.modules || {}).find(({ number }) => number === moduleNum || number === parseInt(moduleNum))
79 if (!moduleInfo && _.size(course.modules || {})) {
80 // Just match indexes in order, since module might not be numbered 1, 2, 3, but rather A1, A2, B1. Zero-indexed vs. one-indexed moduleNum.
81 moduleInfo = Object.values(course.modules)[parseInt(moduleNum) - 1]
82 }
83 return utils.i18n(moduleInfo || {}, 'name')
84 }
85 },
86
87 // Returns either the module info from the course or an empty object.
88 getCurrentModuleHeadingInfo (_state, getters, _rootState, _rootGetters) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected