(hyperlink: string | undefined)
| 61 | private stringMap = new Map<string, number>() |
| 62 | |
| 63 | intern(hyperlink: string | undefined): number { |
| 64 | if (!hyperlink) return 0 |
| 65 | let id = this.stringMap.get(hyperlink) |
| 66 | if (id === undefined) { |
| 67 | id = this.strings.length |
| 68 | this.strings.push(hyperlink) |
| 69 | this.stringMap.set(hyperlink, id) |
| 70 | } |
| 71 | return id |
| 72 | } |
| 73 | |
| 74 | get(id: number): string | undefined { |
| 75 | return id === 0 ? undefined : this.strings[id] |