( segment: string, ref: string, refPointer: string )
| 575 | } |
| 576 | |
| 577 | const decodePointerSegment = ( |
| 578 | segment: string, |
| 579 | ref: string, |
| 580 | refPointer: string |
| 581 | ): string => { |
| 582 | let decoded: string |
| 583 | try { |
| 584 | decoded = decodeURIComponent(segment) |
| 585 | } catch { |
| 586 | // a malformed escape like %ZZ names no key |
| 587 | return throwParseError(writeUnresolvableRefMessage(ref, refPointer)) |
| 588 | } |
| 589 | return decoded.replace(/~1/g, "/").replace(/~0/g, "~") |
| 590 | } |
| 591 | |
| 592 | // the base URI of a document without an absolute $id |
| 593 | const documentUri = "arksets:/document" |
no test coverage detected