It would be more convenient to populate request.path with the results of matching named capture groups, such as that the name of the capture group is available as a property on request.path.
router.get(`/namespace/action/(?<_id>[a-z0-9]*)`, request => {
// still works
const [,, _id] = request.path;
// but also available as
const {"_id": also_id} = request.path;
});
Currently, it is possible to access the parts of a pathname via the
request.path
array:It would be more convenient to populate
request.path
with the results of matching named capture groups, such as that the name of the capture group is available as a property onrequest.path
.