/** JSON type */ export type Json = null | string | number | boolean | Json [ ] | JsonObject ; /** JSON Object type */ export type JsonObject = { [ name ] : Json ; } ; param j export function isJsonObject ( j ) { return typeof j === "object" && ! Array . isArray ( j ) && j !== null ; } param s export function safeJsonParse ( s ) { return JSON . parse ( s , ( _ , value ) => { if ( typeof value === "object" && ! Array . isArray ( value ) && value !== null ) { delete value . __proto__ ; delete value . constructor ; } return value ; } ) ; }