pusk/lib/utils.ml
2023-05-13 22:13:26 +02:00

19 lines
383 B
OCaml

exception Any of string
let fmt = Printf.sprintf
type context = { session_id : string }
let load_dotenv =
(* Load variables *)
let path = "config/.env" in
if Sys.file_exists path then Dotenv.export ~path ()
;;
let keys_to_typing str =
let rec aux acc = function
| 0 -> acc
| n -> aux (String.sub str (n - 1) 1 :: acc) (n - 1)
in
aux [] (String.length str)
;;