When the first segment is optional and not provided, the slash before the required segment is not omitted, which is unexpected for the library code, which adds its own slash.
So route(":optional?/:required").buildPath({ required: "req" }) is "//req", for example.
When the first segment is optional and not provided, the slash before the required segment is not omitted, which is unexpected for the library code, which adds its own slash.
So
route(":optional?/:required").buildPath({ required: "req" })
is"//req"
, for example.