Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

@yamadayuki/bs-url

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@yamadayuki/bs-url

url module bindings for ReasonML

latest
Source
npmnpm
Version
0.4.1
Version published
Maintainers
1
Created
Source

bs-url

url module bindings for BuckleScript in Reason.

Installation

  • Install @yamadayuki/bs-url
$ npm install --save @yamadayuki/bs-url
  • Add @yamadayuki/bs-url to bs-dependencies section of bsconfig.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

  • Support URLSearchParams Done.

Contributing

Build

npm run build

Build + Watch

npm run start

Editor

If you use vscode, Press Windows + Shift + B it will build automatically

Keywords

bucklescript

FAQs

Package last updated on 21 May 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts