MCPcopy Index your code
hub / github.com/BrainicHQ/DoHSpeedTest / normalizeCountryCode

Function normalizeCountryCode

script.js:99–103  ·  view source on GitHub ↗
(value)

Source from the content-addressed store, hash-verified

97}
98
99function normalizeCountryCode(value) {
100 if (typeof value !== 'string') return '';
101 const code = value.trim().toUpperCase();
102 return /^[A-Z]{2}$/.test(code) ? code : '';
103}
104
105function countryFlag(countryCode) {
106 const code = normalizeCountryCode(countryCode);

Callers 3

countryFlagFunction · 0.85
countryLabelFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected