(resource, options)
| 382 | } |
| 383 | |
| 384 | async function fetchJSON(resource, options) { |
| 385 | const response = await fetch(resource, options); |
| 386 | const json = await response.json(); |
| 387 | if (!response.ok) { |
| 388 | throw new MvError(json.error_description ?? json.error?.message, 'GMAIL_API_ERROR'); |
| 389 | } |
| 390 | return json; |
| 391 | } |
| 392 | |
| 393 | function parseQuery(queryString, separator = '&') { |
| 394 | const query = {}; |
no test coverage detected