aboutsummaryrefslogtreecommitdiff
path: root/src/Lib/String.ml
diff options
context:
space:
mode:
authorJoris2022-07-05 21:55:41 +0200
committerJoris2023-01-28 09:35:55 +0100
commit063d8ef9eaf874a941f4459e831057dd0a1b7ddd (patch)
treec4a8b27cb8fdb5d1dc26c560c7483c9593f40dac /src/Lib/String.ml
parent2936f06576997bffe7903ea840df563a408efc21 (diff)
downloadmap-main.tar.gz
map-main.tar.bz2
map-main.zip
Rewrite in TSmain
Diffstat (limited to 'src/Lib/String.ml')
-rw-r--r--src/Lib/String.ml35
1 files changed, 0 insertions, 35 deletions
diff --git a/src/Lib/String.ml b/src/Lib/String.ml
deleted file mode 100644
index be16d0e..0000000
--- a/src/Lib/String.ml
+++ /dev/null
@@ -1,35 +0,0 @@
-let format_float precision f =
- let str = Js.Float.toString f in
- match Js.String.split "." str with
- | [| a ; b |] -> a ^ "." ^ (Js.String.substring ~from:0 ~to_:precision b)
- | _ -> str
-
-external btoa : string -> string = "btoa"
- [@@bs.val] [@@bs.scope "window"]
-
-external atob : string -> string = "atob"
- [@@bs.val] [@@bs.scope "window"]
-
-external unescape : string -> string = "unescape"
- [@@bs.val]
-
-external escape : string -> string = "escape"
- [@@bs.val]
-
-external encodeURIComponent : string -> string = "encodeURIComponent"
- [@@bs.val]
-
-external decodeURIComponent : string -> string = "decodeURIComponent"
- [@@bs.val]
-
-let encode str =
- str
- |> encodeURIComponent
- |> unescape
- |> btoa
-
-let decode str =
- str
- |> atob
- |> escape
- |> decodeURIComponent