fillRoute
Describes@ebitex/content-sdk 1.xSee the changelog:@ebitex/content-sdk
fillRoute<
TPattern>(pattern,params):string
Fills a pattern with a value for each parameter, percent-encoding every value, so the result is a path to link to or navigate to. Throws when a parameter has no value or an empty one: an address with a hole in it is never what a caller meant.
fillRoute('/products/{key}', { key: 'trail runner' }) // '/products/trail%20runner'With a pattern the compiler can read (a string literal), the values are checked at compile time.
Type Parameters
Section titled “Type Parameters”TPattern
Section titled “TPattern”TPattern extends string
Parameters
Section titled “Parameters”pattern
Section titled “pattern”TPattern
params
Section titled “params”RouteParams<TPattern>
Returns
Section titled “Returns”string