Skip to content

basalt / http/src / scriptJson

Function: scriptJson() ​

> scriptJson(value): string

Defined in: http/src/html.ts:37

JSON.stringify a value so it can be embedded inside an inline <script> element without a crafted string ("</script><svg onload=…>") terminating the block early.

Parameters ​

value ​

unknown

Returns ​

string

Released under the MIT License.