MCPcopy Create free account
hub / github.com/basecamp/omarchy / parseStatus

Function parseStatus

shell/plugins/panels/dropbox/Model.js:17–31  ·  view source on GitHub ↗
(raw)

Source from the content-addressed store, hash-verified

15}
16
17function parseStatus(raw) {
18 var text = String(raw || "").trim()
19 if (text === "") return defaultStatus()
20 try {
21 var parsed = JSON.parse(text)
22 if (!parsed || typeof parsed !== "object") return defaultStatus()
23 parsed.files = Array.isArray(parsed.files) ? parsed.files : []
24 return parsed
25 } catch (e) {
26 var failed = defaultStatus()
27 failed.ok = false
28 failed.lastError = "Failed to parse Dropbox status"
29 return failed
30 }
31}
32
33function defaultStatus() {
34 return {

Callers

nothing calls this directly

Calls 1

defaultStatusFunction · 0.85

Tested by

no test coverage detected