(url, body)
| 173 | } |
| 174 | |
| 175 | async function postJson(url, body) { |
| 176 | try { |
| 177 | const resp = await fetch(url, { |
| 178 | method: "POST", |
| 179 | headers: { "content-type": "application/json" }, |
| 180 | body: JSON.stringify(body), |
| 181 | signal: AbortSignal.timeout(5000), |
| 182 | }); |
| 183 | return resp.ok ? await resp.json() : null; |
| 184 | } catch { return null; } |
| 185 | } |
| 186 | |
| 187 | // ── Plugin ─────────────────────────────────────────────────────────── |
| 188 |
no test coverage detected