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
This matches the pathname, but all other URL components are wildcards.
This mostly works for the use case, but is still awkward to use since URLPattern.match() requires parseable full URLs to be passed in. For example:
constinput="/foo/bar/baz";// fails due to invalid inputpattern.match(input);// awkward and expensive, but workspattern.match(newURL(input,self.location).href);
To make this more ergonomic we could allow URLPattern.match() to accept structured input:
pattern.match({pathname: input});
This allows the developer to indicate they only have a pathname. The other components of the URL are unknown and will only match if the pattern has a wildcard specified for the component.
The text was updated successfully, but these errors were encountered:
Sometimes a developer may only care about matching a part of the URL; e.g. just against pathname. The plan of record to support this is:
This matches the pathname, but all other URL components are wildcards.
This mostly works for the use case, but is still awkward to use since
URLPattern.match()
requires parseable full URLs to be passed in. For example:To make this more ergonomic we could allow
URLPattern.match()
to accept structured input:This allows the developer to indicate they only have a pathname. The other components of the URL are unknown and will only match if the pattern has a wildcard specified for the component.
The text was updated successfully, but these errors were encountered: