liquidsoap-prettier 1.4.5 → 1.4.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.ocamlformat +10 -0
- package/dist/liquidsoap.cjs +2367 -8658
- package/dist/web.mjs +1 -1
- package/package.json +1 -1
- package/src/dune +3 -0
- package/src/liquidsoap_js.ml +10 -3
- package/webpack.web.cjs +0 -3
package/package.json
CHANGED
package/src/dune
CHANGED
package/src/liquidsoap_js.ml
CHANGED
|
@@ -1,12 +1,19 @@
|
|
|
1
1
|
open Js_of_ocaml
|
|
2
2
|
open Liquidsoap_lang
|
|
3
3
|
|
|
4
|
-
let () =
|
|
5
|
-
Hooks.regexp := Regexp_js.make
|
|
4
|
+
let () = Hooks.regexp := Regexp_js.make
|
|
6
5
|
|
|
7
6
|
let parse content =
|
|
8
7
|
let content = Js.to_string content in
|
|
9
|
-
let json =
|
|
8
|
+
let json =
|
|
9
|
+
let buf = Buffer.create 0 in
|
|
10
|
+
let formatter = Format.formatter_of_buffer buf in
|
|
11
|
+
try Liquidsoap_tooling.Parsed_json.parse_string ~formatter content
|
|
12
|
+
with _ ->
|
|
13
|
+
Js_error.raise_
|
|
14
|
+
(Js_error.of_error
|
|
15
|
+
(new%js Js.error_constr (Js.string (Buffer.contents buf))))
|
|
16
|
+
in
|
|
10
17
|
Js._JSON##parse
|
|
11
18
|
(Js.string (Liquidsoap_lang.Json.to_string ~compact:true json))
|
|
12
19
|
|