(id: string)
| 58 | }; |
| 59 | |
| 60 | export const removeId = (id: string) => { |
| 61 | const slot = idSlots.get(id); |
| 62 | if (slot === undefined) { |
| 63 | return false; |
| 64 | } |
| 65 | idSlots.delete(id); |
| 66 | const state = prefixStates.get(slot.prefix); |
| 67 | if (state !== undefined) { |
| 68 | state.used.delete(slot.index); |
| 69 | if (slot.index < state.next) { |
| 70 | state.next = slot.index; |
| 71 | } |
| 72 | if (state.used.size === 0) { |
| 73 | prefixStates.delete(slot.prefix); |
| 74 | } |
| 75 | } |
| 76 | return true; |
| 77 | }; |
| 78 | |
| 79 | export const clearAllIds = () => { |
| 80 | idSlots.clear(); |
no outgoing calls
no test coverage detected
searching dependent graphs…