(target: object)
| 43 | } |
| 44 | |
| 45 | export function untrackStub(target: object): void { |
| 46 | if (!trackingEnabled) return; |
| 47 | const name = target.constructor?.name ?? "anonymous"; |
| 48 | const current = counters.get(name) ?? 0; |
| 49 | if (current <= 1) counters.delete(name); |
| 50 | else counters.set(name, current - 1); |
| 51 | } |
| 52 | |
| 53 | // Snapshot the current live counts. Empty object when tracking is |
| 54 | // disabled or when nothing is live. Callers should not mutate the |
no test coverage detected