Skip to content

Interface: ParamPart

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

Defined in: packages/play-pattern/src/pattern-grammar.ts:71

A param: :name, (\d+), or *.

An anonymous param carries no name. URLPattern numbers such a group from 0, and this library reports it to no machine — see ParsedPattern.params.

Properties

PropertyModifierTypeDescriptionDefined in
groupNamereadonlystring | nullThe name that URLPattern compiles, with each hyphen rewritten to an underscore, or null for an anonymous param. The rewrite happens ONE time, here, and ParsedPattern.normalized carries the same characters. A caller that needs the group name of a param reads this field, and it rewrites nothing of its own.packages/play-pattern/src/pattern-grammar.ts:83
kindreadonly"param"-packages/play-pattern/src/pattern-grammar.ts:72
modifierreadonlyPatternModifier-packages/play-pattern/src/pattern-grammar.ts:88
namereadonlystring | nullThe declared name, with each hyphen kept, or null for an anonymous param.packages/play-pattern/src/pattern-grammar.ts:74
prefixreadonlystringThe / that the param absorbed from the literal before it, or "".packages/play-pattern/src/pattern-grammar.ts:87
regexpreadonlystring | nullThe source of the constraint of :id(\d+), or null when the param declares none.packages/play-pattern/src/pattern-grammar.ts:85