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

Method includesCourse

app/models/Prepaid.js:99–109  ·  view source on GitHub ↗
(course)

Source from the content-addressed store, hash-verified

97 }
98
99 includesCourse (course) {
100 const courseID = (typeof course.get === 'function' ? course.get('name') : undefined) || course
101 if (this.get('type') === 'starter_license') {
102 const left = this.get('includedCourseIDs') || []
103 return left.includes(courseID)
104 } else {
105 // no includedCourseIDs means full-license, so always return true
106 const left1 = this.get('includedCourseIDs') || [courseID]
107 return left1.includes(courseID)
108 }
109 }
110
111 numericalCourses () {
112 if (!__guard__(this.get('includedCourseIDs'), x => x.length)) { return utils.courseNumericalStatus.FULL_ACCESS }

Callers 2

assignCourseFunction · 0.80
assignCourseMethod · 0.80

Calls 1

getMethod · 0.45

Tested by

no test coverage detected