Given the URL:
var urlString = "http://somehost:9090/cars;color=red;make=Tesla?page=1&perPage=10"
I'd like some javascript (node) library which i can use to get the matrix parameters (color and make) for the cars path segment, for example:
var url = URL.parse(urlString)
url.pathSegments["cars"].params
would yield
{
"color": "red",
"make": "Tesla"
}
Also, ideally such a library should take into consideration proper decoding for path segment parameters, which is not the same decoding as query parameters.
These params (along with a bunch of other useful information concerning urls) are described in more detail in the following article:
https://www.talisman.org/~erlkonig/misc/lunatech%5Ewhat-every-webdev-must-know-about-url-encoding/
I've done plenty of googling, but have come up empty, but hopefully I'm just blind!