(raw)
| 15 | } |
| 16 | |
| 17 | function 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 | |
| 33 | function defaultStatus() { |
| 34 | return { |
nothing calls this directly
no test coverage detected