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

Function setUpTv4

app/core/initialize.js:247–265  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

245}
246
247var setUpTv4 = function () {
248 const forms = require('core/forms')
249 return tv4.addFormat({
250 'email' (email) {
251 if (forms.validateEmail(email)) {
252 return null
253 } else {
254 return { code: tv4.errorCodes.FORMAT_CUSTOM, message: $.t('form_validation_errors.requireValidEmail') }
255 }
256 },
257 'phoneNumber' (phoneNumber) {
258 if (forms.validatePhoneNumber(phoneNumber)) {
259 return null
260 } else {
261 return { code: tv4.errorCodes.FORMAT_CUSTOM, message: $.t('form_validation_errors.requireValidPhone') }
262 }
263 }
264 })
265}
266
267var setupConsoleLogging = function () {
268 // IE9 doesn't expose console object unless debugger tools are loaded

Callers 1

initFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected