1.0.2 • Published 1 year ago
mw-url v1.0.2
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",
})