import getUrl from "mw-url"
//returns the window.location as string
getUrl()
//returns https://exemple.com
getUrl("https://exemple.com")
//returns the window.location with path /home
getUrl(undefined, "/home")
//returns https://exemple.com/home
getUrl("https://exemple.com", "/home")
//returns the window.location with path /home and search params
getUrl(undefined, "/home", {
user: "admin",
password: "1234",
})
//returns https://exemple.com/login?user=admin&password=1234
getUrl("https://exemple.com", "/login", {
user: "admin",
password: "1234",
})
mw-url
1.0.2 • Public • PublishedPackage Sidebar
Install
npm i mw-url
Weekly Downloads
1
Version
1.0.2
License
ISC
Unpacked Size
1.53 kB
Total Files
4