Skip to content

Function: holdsUnsubstitutedParam()

API / @xmachines/play-url / index / holdsUnsubstitutedParam

function holdsUnsubstitutedParam(pathname): boolean;

Defined in: packages/play-url/src/url-pattern-utils.ts:96

Tells you if a CONCRETE path still carries a param that nothing substituted.

This is a different question from the parameterized field of a parse, and it needs a different test. RouterBridgeBase.resolveNavigationPath asks it about a value that the ACTOR reports, which is a real path built from real param values — and a real path carries a character of the pattern grammar whenever a param value does. /search/a+b, /tags/c++, /docs/rfc(2119) and /i18n/{en} are all ordinary locations, and the grammar reads a modifier, a constraint and a group in them. A bridge that judged them by the grammar refused to navigate, and it said nothing.

The test is therefore narrow on purpose: : and * are the two characters that mark a param a substitution did not fill, and a path that holds one of them can reach the URL bar never. A param VALUE that holds one of them is refused too, which is the price, and it is the price this library paid before the grammar existed.

Parameters

ParameterTypeDescription
pathnamestringThe PATHNAME half of an actor route, with the query already removed.

Returns

boolean

true when the path cannot go to the URL bar as it stands