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

Function ageOfConsent

app/core/utils.js:195–203  ·  view source on GitHub ↗
(countryName, defaultIfUnknown)

Source from the content-addressed store, hash-verified

193const addressesIncludeAdministrativeRegion = country => !!__guard__(_.find(countries, c => c.country === slugify(country)), x1 => x1.addressesIncludeAdministrativeRegion)
194
195const ageOfConsent = function (countryName, defaultIfUnknown) {
196 if (defaultIfUnknown == null) { defaultIfUnknown = 0 }
197 if (!countryName) { return defaultIfUnknown }
198 const country = _.find(countries, c => c.country === slugify(countryName))
199 if (!country) { return defaultIfUnknown }
200 if (country.ageOfConsent) { return country.ageOfConsent }
201 if (country.inEU) { return 16 }
202 return defaultIfUnknown
203}
204
205const countryCodeToFlagEmoji = function (code) {
206 if ((code != null ? code.length : undefined) !== 2) { return code }

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected