PR-URL: https://github.com/nodejs/node/pull/58537 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Filip Skokan <panva.ip@gmail.com> Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
116 lines
2.4 KiB
JSON
116 lines
2.4 KiB
JSON
[
|
|
{
|
|
"pattern": { "pathname": "/foo" },
|
|
"component": "invalid",
|
|
"groups": {},
|
|
"expected": null
|
|
},
|
|
{
|
|
"pattern": { "pathname": "/foo" },
|
|
"component": "pathname",
|
|
"groups": {},
|
|
"expected": "/foo"
|
|
},
|
|
{
|
|
"pattern": { "pathname": "/:foo" },
|
|
"component": "pathname",
|
|
"groups": { "foo": "bar" },
|
|
"expected": "/bar"
|
|
},
|
|
{
|
|
"pattern": { "pathname": "/:foo" },
|
|
"component": "pathname",
|
|
"groups": { "foo": "🍅" },
|
|
"expected": "/%F0%9F%8D%85"
|
|
},
|
|
{
|
|
"pattern": { "hostname": "{:foo}.example.com" },
|
|
"component": "hostname",
|
|
"groups": { "foo": "🍅" },
|
|
"expected": "xn--fi8h.example.com"
|
|
},
|
|
{
|
|
"pattern": { "pathname": "/:foo" },
|
|
"component": "pathname",
|
|
"groups": {},
|
|
"expected": null
|
|
},
|
|
{
|
|
"pattern": { "pathname": "/foo/:bar" },
|
|
"component": "pathname",
|
|
"groups": { "bar": "baz" },
|
|
"expected": "/foo/baz"
|
|
},
|
|
{
|
|
"pattern": { "pathname": "/foo:bar" },
|
|
"component": "pathname",
|
|
"groups": { "bar": "baz" },
|
|
"expected": "/foobaz"
|
|
},
|
|
{
|
|
"pattern": { "pathname": "/:foo/:bar" },
|
|
"component": "pathname",
|
|
"groups": { "foo": "baz", "bar": "qux" },
|
|
"expected": "/baz/qux"
|
|
},
|
|
{
|
|
"pattern": "https://example.com/:foo",
|
|
"component": "pathname",
|
|
"groups": { "foo": " " },
|
|
"expected": "/%20"
|
|
},
|
|
{
|
|
"pattern": "original-scheme://example.com/:foo",
|
|
"component": "pathname",
|
|
"groups": { "foo": " " },
|
|
"expected": "/ "
|
|
},
|
|
{
|
|
"pattern": { "pathname": "/:foo" },
|
|
"component": "pathname",
|
|
"groups": { "foo": "bar/baz" },
|
|
"expected": null
|
|
},
|
|
{
|
|
"pattern": { "pathname": "*" },
|
|
"component": "pathname",
|
|
"groups": {},
|
|
"expected": null
|
|
},
|
|
{
|
|
"pattern": { "pathname": "/{foo}+" },
|
|
"component": "pathname",
|
|
"groups": {},
|
|
"expected": null
|
|
},
|
|
{
|
|
"pattern": { "pathname": "/{foo}?" },
|
|
"component": "pathname",
|
|
"groups": {},
|
|
"expected": null
|
|
},
|
|
{
|
|
"pattern": { "pathname": "/{foo}*" },
|
|
"component": "pathname",
|
|
"groups": {},
|
|
"expected": null
|
|
},
|
|
{
|
|
"pattern": { "pathname": "/(regexp)" },
|
|
"component": "pathname",
|
|
"groups": {},
|
|
"expected": null
|
|
},
|
|
{
|
|
"pattern": { "pathname": "/([^\\/]+?)" },
|
|
"component": "pathname",
|
|
"groups": {},
|
|
"expected": null
|
|
},
|
|
{
|
|
"pattern": { "port": "([^\\:]+?)" },
|
|
"component": "port",
|
|
"groups": {},
|
|
"expected": null
|
|
}
|
|
]
|