Package Exports
- @yamadayuki/bs-url
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@yamadayuki/bs-url) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
bs-url
url module bindings for BuckleScript in Reason.
Installation
- Install
@yamadayuki/bs-url
$ npm install --save @yamadayuki/bs-url- Add
@yamadayuki/bs-urltobs-dependenciessection ofbsconfig.json.
Usage
Create URL object.
let myURL = URL.make("https://example.com");
Js.log(myURL);
/* Prints https://example.com */
let otherURL = URL.make("/foo", "https://example.com");
Js.log(otherURL);
/* Prints https://example.com/foo */Get member in URL object.
URL.make("https://example.com/foo#bar")
|> URL.hash
|> Js.log
/* Prints #bar */Resove a target URL relative to a base URL.
URL.resolve("https://example.com/", "/foo") /* https://example.com/foo */Create URLSearchParams object.
/* from String */
let params0 = URLSearchParmas.make("user=abc&query=xyz");
/* from Object */
let params1 = URLSearchParmas.makeWithObject({"user": "abc", "query": [|"first", "second"|]});
/* from Array */
let params2 = URLSearchParmas.makeWithArray([|("user", "abc"), ("query", "first"), ("query", "second")|])TODO
SupportDone.URLSearchParams
Contributing
Build
npm run buildBuild + Watch
npm run startEditor
If you use vscode, Press Windows + Shift + B it will build automatically