The inverse: the concrete path this id names under this template.
undefined when the id does not fill the template — a missing variable, or one whose value is
empty. It refuses rather than substituting a blank, because a path with a hole in it addresses
a DIFFERENT entity (one segment shorter) rather than failing, which is the silent kind of wrong.
Extra keys in the id are ignored: a broadcast frame's id is the canonical spelling and may
carry more than one template's variables.
encodeSegment transforms each SUBSTITUTED value and nothing else. It exists because the two
renderings a caller wants differ only there: a URL needs encodeURIComponent so an id
carrying a slash (src/1) stays one segment, and a display or address rendering needs the id
verbatim. Applying it after the join would be too late — the separator and the character
inside the value would already be the same byte. Literal segments are never transformed: they
come from the template, which this console wrote.
The inverse: the concrete path this id names under this template.
undefinedwhen the id does not fill the template — a missing variable, or one whose value is empty. It refuses rather than substituting a blank, because a path with a hole in it addresses a DIFFERENT entity (one segment shorter) rather than failing, which is the silent kind of wrong.Extra keys in the id are ignored: a broadcast frame's id is the canonical spelling and may carry more than one template's variables.
encodeSegmenttransforms each SUBSTITUTED value and nothing else. It exists because the two renderings a caller wants differ only there: a URL needsencodeURIComponentso an id carrying a slash (src/1) stays one segment, and a display or address rendering needs the id verbatim. Applying it after the join would be too late — the separator and the character inside the value would already be the same byte. Literal segments are never transformed: they come from the template, which this console wrote.