Skip to content

Commit b2f0a63

Browse files
haraldschillyclaude
andcommitted
backend: make ProcessStats constructor private for strict singleton
- Add private keyword to ProcessStats constructor - Prevents direct instantiation with `new ProcessStats()` - Enforces use of `ProcessStats.getInstance()` method - TypeScript will now catch attempts to bypass singleton pattern 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent b618234 commit b2f0a63

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/packages/backend/process-stats.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export class ProcessStats {
4747
private pagesize: number;
4848
private last?: { timestamp: number; processes: Processes };
4949

50-
constructor(opts?: ProcessStatsOpts) {
50+
private constructor(opts?: ProcessStatsOpts) {
5151
this.procLimit = opts?.procLimit ?? LIMIT;
5252
this.dbg = opts?.dbg ?? getLogger("process-stats").debug;
5353
this.init();

0 commit comments

Comments
 (0)