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

Function bracketToAge

app/core/utils.js:1394–1413  ·  view source on GitHub ↗
(slug)

Source from the content-addressed store, hash-verified

1392}
1393
1394const bracketToAge = function (slug) {
1395 let higherBound, i, lowerBound
1396 let asc, end
1397 let asc1, end1
1398 for (i = 0, end = ageBrackets.length, asc = end >= 0; asc ? i < end : i > end; asc ? i++ : i--) {
1399 if (ageBrackets[i].slug === slug) {
1400 lowerBound = i === 0 ? 0 : ageBrackets[i - 1].max
1401 higherBound = ageBrackets[i].max
1402 return { $gt: lowerBound, $lte: higherBound }
1403 }
1404 }
1405
1406 for (i = 0, end1 = ageBracketsChina.length, asc1 = end1 >= 0; asc1 ? i < end1 : i > end1; asc1 ? i++ : i--) {
1407 if (ageBracketsChina[i].slug === slug) {
1408 lowerBound = i === 0 ? 0 : ageBracketsChina[i - 1].max
1409 higherBound = ageBracketsChina[i].max
1410 return { $gt: lowerBound, $lte: higherBound }
1411 }
1412 }
1413}
1414
1415const CODECOMBAT = 'codecombat'
1416const CODECOMBAT_CHINA = 'koudashijie'

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected