Skip to content

t8js/quasiurl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

quasiurl

URL-like object for templated URLs

Unlike URL, QuasiURL:

  • can have an empty origin, pathname, hostname, protocol;
  • preserves templating characters without URL-encoding them;
  • doesn't implement the entire URL spec.
new URL("/x").href
> TypeError: URL constructor: /x is not a valid URL.

new QuasiURL("/x").href
> "/x"

new URL("https://a.aa/x{/:name}").pathname
> "/x%7B/:name%7D"

new QuasiURL("https://a.aa/x{/:name}").pathname
> "/x{/:name}"

About

URL-like object for templated URLs

Topics

Resources

License

Stars

Watchers

Forks