refactor: address comments

This commit is contained in:
Rishabh Agarwal
2022-04-18 19:29:45 +05:30
committed by Andrew Bastin
parent ed49c0b72c
commit 3afd2c1cf2
3 changed files with 43 additions and 34 deletions

View File

@@ -7,3 +7,6 @@ import * as O from "fp-ts/Option"
*/
export const safeParseJSON = (str: string): O.Option<object> =>
O.tryCatch(() => JSON.parse(str))
export const prettyPrintStringifyJSON = (jsonObject: any): O.Option<string> =>
O.tryCatch(() => JSON.stringify(jsonObject, null, "\t"))