mw-url
v1.0.2
Published
To Get A URL Easyly
Downloads
5
Readme
mw-url
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",
})