Creates a new Path that maps the params of the given path to an object with a single key.
This is useful for assigning a name to a path parameter, so that the matched value is returned
as an object with the specified key, rather than as a raw value.
For example, keyAs("id", parseNumber) will produce a Path that matches a number and returns
{ id: number } as params.
Creates a new Path that maps the params of the given
pathto an object with a single key.This is useful for assigning a name to a path parameter, so that the matched value is returned as an object with the specified key, rather than as a raw value.
For example,
keyAs("id", parseNumber)will produce a Path that matches a number and returns{ id: number }as params.