import stringify from "json-stable-stringify" ; export function fromJSON < T > ( input ) { return JSON . parse ( input ) as T ; } export function toJSON < T > ( input ) { return stringify ( input ) ; } export function toPrettyJSON < T > ( input ) { return stringify ( input , { space : 4 } ) ; }