(table: Array<unknown>, layout: Layout, r: Reader)
| 4769 | type RunSlot = Field | null | undefined |
| 4770 | |
| 4771 | function decodeInterned(table: Array<unknown>, layout: Layout, r: Reader): unknown { |
| 4772 | const code = r.uvarint() |
| 4773 | if ((code & 1) === 1) { |
| 4774 | const ref = (code - 1) / 2 |
| 4775 | if (ref >= table.length) invalid("a known back-reference", undefined, r.options) |
| 4776 | return table[ref] |
| 4777 | } |
| 4778 | // Plain strings consume their whole region, so they skip the reader window. |
| 4779 | if (layout._ === "string") { |
| 4780 | if (r.dict !== undefined) { |
| 4781 | const saved = r.enter(code / 2) |
| 4782 | const value = decodeChecked(layout, r) |
| 4783 | r.exit(saved) |
| 4784 | table.push(value) |
| 4785 | return value |
| 4786 | } |
| 4787 | const value = r.readUtf8(code / 2) |
| 4788 | table.push(value) |
| 4789 | return value |
| 4790 | } |
| 4791 | const saved = r.enter(code / 2) |
| 4792 | const value = decodeChecked(layout, r) |
| 4793 | r.exit(saved) |
| 4794 | table.push(value) |
| 4795 | return value |
| 4796 | } |
| 4797 | |
| 4798 | function decodeStructRun(plan: RunPlan, count: number, r: Reader): Array<unknown> { |
| 4799 | const out: Array<unknown> = new Array(count) |
no test coverage detected