Sync deploy mirror and upstream error page
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
export function shinyFlagUrl(countryCode, filesCdnUrl = '') {
|
||||
const normalized = String(countryCode ?? '').trim().toUpperCase()
|
||||
|
||||
if (!/^[A-Z]{2}$/.test(normalized)) {
|
||||
return null
|
||||
}
|
||||
|
||||
const base = String(filesCdnUrl ?? '').replace(/\/+$/, '')
|
||||
const relativePath = `/images/flags/shiny/24/${encodeURIComponent(normalized)}.png`
|
||||
|
||||
return base ? `${base}${relativePath}` : relativePath
|
||||
}
|
||||
Reference in New Issue
Block a user