(error: unknown, status: number)
| 201 | } |
| 202 | |
| 203 | function errorJSON(error: unknown, status: number): Response { |
| 204 | const message = error instanceof Error ? error.message : String(error); |
| 205 | const code = (error as { code?: string }).code; |
| 206 | return new Response(JSON.stringify({ error: message, code }), { |
| 207 | status, |
| 208 | headers: { "content-type": "application/json" }, |
| 209 | }); |
| 210 | } |
| 211 | |
| 212 | function shellQuote(arg: string): string { |
| 213 | if (/^[A-Za-z0-9_\-+=:,./@%]+$/.test(arg)) return arg; |
no outgoing calls
no test coverage detected