refactor: address comments

This commit is contained in:
Rishabh Agarwal
2022-04-18 19:29:45 +05:30
parent 2aef9c5691
commit 2fd9eb0767
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"))