Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | 22x 22x 22x 8x 22x | import null_ from './null.js' import nstring from './nstring.js' import type S from './sanitised.js' /** * @returns stringified json. * * `undefined` value is serialised as NULL. */ export const json = (x: unknown): S => typeof x === 'undefined' ? null_ : nstring(JSON.stringify(x)) export default json |