toNormalizedPath

This location in RFC 9535 §2.7's Normalized Path form: $['items'][0]['sku'].

The interchange spelling, and deliberately not the engine's. toString writes $.items[0].sku and falls back to a bracket only for a name that is not a bare identifier; §2.7 has no dot form and no fork, so one location has exactly one normalized rendering. That is the property which makes two of these comparable as text, and it is the one toString cannot claim.

Member names are single-quoted, with the seven escapes §2.7 names — \', \\, \b, \f, \n, \r, \t — and \u00xx in lowercase for the remaining control characters. A double quote is not escaped, and neither is a solidus: inside single quotes both are ordinary. parseNormalized is the inverse and round-trips this exactly.

This is not what the engine writes to disk. A path is persisted as toString and read back by parse. Reach for this to hand a location to something outside the engine, and for toString everywhere else.

Throws

if a field name holds an unpaired surrogate, which §2.7 has no production for. A name decoded from a stored document cannot hold one — UTF-8 has no encoding for a lone surrogate — so this is reachable only from a path built in memory.