(written: string)
| 121 | |
| 122 | // compiled code declares functions by id, so an alias prefix is written as an identifier |
| 123 | export const registerNodeId = (written: string): NodeId => { |
| 124 | const prefix = (idPrefixes[written] ??= idPrefixOf(written)) |
| 125 | const count = (nodeCountsByPrefix[prefix] ?? 0) + 1 |
| 126 | nodeCountsByPrefix[prefix] = count |
| 127 | return `${prefix}${count}` as NodeId |
| 128 | } |
| 129 | |
| 130 | const idPrefixes: PartialRecord<string, string> = Object.create(null) |
| 131 |
no test coverage detected