Function: getCompiledPattern()
API / @xmachines/play-url / index / getCompiledPattern
function getCompiledPattern(pattern): URLPatternLike;Defined in: packages/play-url/src/url-pattern-utils.ts:216
Compiles a route pattern into a URLPattern, and it uses the cache of the module level
again.
normalizeParamNames normalizes the pattern before the compilation. A param name
with a hyphen (:cat-id) therefore becomes a valid URLPattern identifier (:cat_id).
A caller that reads the values of the groups must map each normalized name back with
getNormalizedParamNameMap.
Parameters
| Parameter | Type | Description |
|---|---|---|
pattern | string | The string of the route pattern, for example /profile/:userId |
Returns
Throws
When URLPattern cannot compile the pattern.