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

Function sanitizeStateCode

app/core/utils.js:1194–1197  ·  view source on GitHub ↗
(code)

Source from the content-addressed store, hash-verified

1192 // returns null if can't find sanitized code in the state map
1193
1194 const sanitizeStateCode = function (code) {
1195 code = _.isString(code) ? code.trim().toUpperCase().replace(/[^A-Z]/g, '') : null
1196 if (stateNamesByCode[code]) { return code } else { return null }
1197 }
1198
1199 // returns a valid state name else null
1200

Callers 1

getStateNameByStateCodeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected