- export function coerceIceServerList(list) {
- if (!Array.isArray(list) || !list.length) return null
- return list.map((entry) => {
- if (!entry || typeof entry !== 'object') return entry
- const normalized = { ...entry }
- if (typeof normalized.urls === 'string') {
- normalized.urls = [normalized.urls]
- } else if (normalized.url && !normalized.urls) {
- normalized.urls = [normalized.url]
- delete normalized.url
- }
- return normalized
- })
- }
|