MCPcopy Index your code
hub / github.com/simstudioai/sim / httpHeaderSafeJson

Function httpHeaderSafeJson

apps/sim/lib/core/utils/validation.ts:59–63  ·  view source on GitHub ↗
(value: object)

Source from the content-addressed store, hash-verified

57 * Dropbox API requires characters 0x7F and all non-ASCII to be escaped as \uXXXX.
58 */
59export 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}

Callers 2

download.tsFile · 0.90
route.tsFile · 0.90

Calls 2

replaceMethod · 0.65
toStringMethod · 0.45

Tested by

no test coverage detected