Published on2026年10月20日设计模式(五)之单例模式设计模式typescriptsingleton保证一个类在进程里只有一个实例。对比 TypeScript 类单例和 ES 模块单例,并说明测试与多实例边界。