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

Function safeJson

public/js/folderManager.js:62–73  ·  view source on GitHub ↗
(res)

Source from the content-addressed store, hash-verified

60 Helpers: safe JSON + state
61----------------------*/
62async function safeJson(res) {
63 const text = await res.text();
64 let body = null;
65 try { body = text ? JSON.parse(text) : null; } catch (e) { /* ignore */ }
66 if (!res.ok) {
67 const msg = (body && (body.error || body.message)) || (text && text.trim()) || `HTTP ${res.status}`;
68 const err = new Error(msg);
69 err.status = res.status;
70 throw err;
71 }
72 return body ?? {};
73}
74
75function disableAllFolderControls() {
76 ['createFolderBtn','moveFolderBtn','renameFolderBtn','colorFolderBtn','deleteFolderBtn','shareFolderBtn']

Callers 8

fetchChildrenOnceFunction · 0.70
loadMoreChildrenFunction · 0.70
setFolderEncryptionFunction · 0.70
tickOnceFunction · 0.70
statusOnceFunction · 0.70
startFolderCryptoJobFlowFunction · 0.70
renameFolderInlineFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected