(value: object)
| 57 | * Dropbox API requires characters 0x7F and all non-ASCII to be escaped as \uXXXX. |
| 58 | */ |
| 59 | export function httpHeaderSafeJson(value: object): string { |
| 60 | return JSON.stringify(value).replace(/[\u007f-\uffff]/g, (c) => { |
| 61 | return `\\u${(`0000${c.charCodeAt(0).toString(16)}`).slice(-4)}` |
| 62 | }) |
| 63 | } |
no test coverage detected