(obj: object)
| 67 | const charsToEncode = /[\u007f-\uffff]/g; |
| 68 | |
| 69 | export function jsonHeader(obj: object) { |
| 70 | // https://stackoverflow.com/a/40347926 |
| 71 | return JSON.stringify(obj).replace(charsToEncode, function (c) { |
| 72 | return '\\u' + ('000' + c.charCodeAt(0).toString(16)).slice(-4); |
| 73 | }); |
| 74 | } |
| 75 | |
| 76 | export function wrapAbort(signal?: IsoAbortSignal) { |
| 77 | const ctl = new AbortController(); |