Created
April 3, 2018 17:24
-
-
Save liubko/5ed1192333f8ef1166027702576070d6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[@bs.module] | |
external encode' : | |
( | |
Js.t({..}), | |
Js.nullable(string), | |
Js.nullable(string), | |
Js.nullable(string) | |
) => | |
string = | |
"querystring/encode"; | |
let encode = (~sep=?, ~eq=?, ~name=?, obj) => | |
Js.Nullable.( | |
encode'(obj, fromOption(sep), fromOption(eq), fromOption(name)) | |
); | |
let stringify = encode; | |
type options = {. "maxKeys": int}; | |
[@bs.module] | |
external decode' : | |
( | |
string, | |
Js.nullable(string), | |
Js.nullable(string), | |
Js.nullable(options) | |
) => | |
Js.t({..}) = | |
"querystring/decode"; | |
let decode = (~sep=?, ~eq=?, ~options=?, qsStr) => | |
Js.Nullable.( | |
decode'(qsStr, fromOption(sep), fromOption(eq), fromOption(options)) | |
); | |
let parse = decode; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment