Skip to content

Commit

Permalink
feat: add stringify
Browse files Browse the repository at this point in the history
  • Loading branch information
glennsl committed Jul 17, 2022
1 parent f18c70b commit 5a90db4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Json.res
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,5 @@ let parseExn = str =>
| Js.Exn.Error(ex) =>
raise(ParseError(ex->Js.Exn.message->Js.Option.getWithDefault("Unknown error", _)))
}

@val external stringify: Js.Json.t => string = "JSON.stringify"
2 changes: 2 additions & 0 deletions src/Json.resi
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@ let decode: (Js.Json.t, Decode.t<'a>) => result<'a, string>

let parse: string => result<Js.Json.t, string>
let parseExn: string => Js.Json.t

@val external stringify: Js.Json.t => string = "JSON.stringify"

0 comments on commit 5a90db4

Please sign in to comment.