diff --git a/src/Json.res b/src/Json.res index 8110a49..2a04671 100644 --- a/src/Json.res +++ b/src/Json.res @@ -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" diff --git a/src/Json.resi b/src/Json.resi index da1d64e..d16d0ef 100644 --- a/src/Json.resi +++ b/src/Json.resi @@ -7,3 +7,5 @@ let decode: (Js.Json.t, Decode.t<'a>) => result<'a, string> let parse: string => result let parseExn: string => Js.Json.t + +@val external stringify: Js.Json.t => string = "JSON.stringify"