fully-react
Version:
React Server for Vite
9 lines (7 loc) • 301 B
TypeScript
/**
* Properly escape JSON for usage as an object literal inside of a `<script>` tag.
* JS implementation of http://golang.org/pkg/encoding/json/#HTMLEscape
* More info: http://timelessrepo.com/json-isnt-a-javascript-subset
*/
declare function sanitize(str: string): string;
export { sanitize };