inline json-stringify-safe