MCPcopy Create free account
hub / github.com/error311/FileRise / getSourceTypeById

Function getSourceTypeById

public/js/folderManager.js:209–229  ·  view source on GitHub ↗
(sourceId)

Source from the content-addressed store, hash-verified

207}
208
209function 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
231function isTrashDisabledForSource(sourceId = '') {
232 const id = String(sourceId || getActiveSourceId() || '').trim();

Callers 3

isFtpSourceIdFunction · 0.70
getCountTimeoutMsFunction · 0.70
folderManager.jsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected