MCPcopy Index your code
hub / github.com/codecombat/codecombat / getHeroClasses

Method getHeroClasses

app/models/User.js:499–505  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

497 }
498
499 getHeroClasses () {
500 const idsToSlugs = _.invert(ThangTypeConstants.heroes)
501 const myHeroSlugs = (this.heroes().map((id) => idsToSlugs[id]))
502 const myHeroClasses = []
503 for (const heroClass in ThangTypeConstants.heroClasses) { const heroSlugs = ThangTypeConstants.heroClasses[heroClass]; if (_.intersection(myHeroSlugs, heroSlugs).length) { myHeroClasses.push(heroClass) } }
504 return myHeroClasses
505 }
506
507 validate () {
508 const errors = super.validate()

Callers 1

onItemsFetchedMethod · 0.80

Calls 1

heroesMethod · 0.95

Tested by

no test coverage detected