You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Current behavior:
If multiple <stencil-route-link> elements define urlMatch using regular expressions, only one of the elements will correctly match the URL.
Expected behavior:
Multiple <stencil-route-link> elements should be able to define urlMatch using regular expressions.
Steps to reproduce:
Define multiple <stencil-route-link> elements with urlMatch using regular expressions:
Notice that only one of the two elements will match its URL.
Related code:
The compilePath() function uses JSON.stringify() to generate a cache pattern, cachePattern. If pattern is a regular expression or an array of regular expressions, the cache pattern will contain a non-unique value such as "{}" or "[{}]":
Other information:
Given the pattern [/^\/docs(?!\/(api|components|cli|native)).*$/] the compilePath() function generates the cache pattern "[{}]":
The text was updated successfully, but these errors were encountered:
claviska
changed the title
Incorrect match when mulitple urlMatch attributes are defined as regular expressions
Incorrect match when multiple urlMatch attributes are defined as regular expressions
Nov 11, 2020
Stencil version:
I'm submitting a ... (check one with "x")
Current behavior:
If multiple
<stencil-route-link>
elements defineurlMatch
using regular expressions, only one of the elements will correctly match the URL.Expected behavior:
Multiple
<stencil-route-link>
elements should be able to defineurlMatch
using regular expressions.Steps to reproduce:
Define multiple
<stencil-route-link>
elements withurlMatch
using regular expressions:Notice that only one of the two elements will match its URL.
Related code:
The
compilePath()
function usesJSON.stringify()
to generate a cache pattern,cachePattern
. Ifpattern
is a regular expression or an array of regular expressions, the cache pattern will contain a non-unique value such as"{}"
or"[{}]"
:https://github.com/ionic-team/stencil-router/blob/228e1f3888759d651aa436ea3bfe5201e5872803/packages/router/src/utils/match-path.ts#L15-L18
Other information:
Given the pattern
[/^\/docs(?!\/(api|components|cli|native)).*$/]
thecompilePath()
function generates the cache pattern"[{}]"
:The text was updated successfully, but these errors were encountered: