(sourceId)
| 207 | } |
| 208 | |
| 209 | function getSourceTypeById(sourceId) { |
| 210 | const id = String(sourceId || '').trim(); |
| 211 | if (!id) return ''; |
| 212 | try { |
| 213 | if (typeof window.__frGetSourceMetaById === 'function') { |
| 214 | const meta = window.__frGetSourceMetaById(id); |
| 215 | if (meta && typeof meta === 'object' && meta.type) return String(meta.type || ''); |
| 216 | } |
| 217 | } catch (e) { /* ignore */ } |
| 218 | try { |
| 219 | if (typeof window.__frGetSourceTypeById === 'function') { |
| 220 | return String(window.__frGetSourceTypeById(id) || ''); |
| 221 | } |
| 222 | } catch (e) { /* ignore */ } |
| 223 | const sel = document.getElementById('sourceSelector'); |
| 224 | if (sel) { |
| 225 | const opt = Array.from(sel.options).find(o => o.value === id); |
| 226 | if (opt) return String(opt.dataset?.sourceType || ''); |
| 227 | } |
| 228 | return ''; |
| 229 | } |
| 230 | |
| 231 | function isTrashDisabledForSource(sourceId = '') { |
| 232 | const id = String(sourceId || getActiveSourceId() || '').trim(); |
no outgoing calls
no test coverage detected