* Decodes a URL-encoded object key returned when `encoding-type=url` is set. * Falls back to the raw value if decoding fails (malformed percent sequence).
(value: string)
| 376 | * Falls back to the raw value if decoding fails (malformed percent sequence). |
| 377 | */ |
| 378 | function decodeObjectKey(value: string): string { |
| 379 | try { |
| 380 | return decodeURIComponent(value) |
| 381 | } catch { |
| 382 | return value |
| 383 | } |
| 384 | } |
| 385 | |
| 386 | /** |
| 387 | * Extracts the text content of the first matching XML tag within a fragment. |