找出 Client 设置里的 bug

来自 严格模式
TypeScript 6 进阶 4分钟 找出 2处问题

找出这个生成的严格模式客户端为何仍可能在发送请求前失败。

TypeScript
interface Settings {
  endpoint: string;
}

class Client {
  private endpoint!: string;

  load(text: string): void {
    const settings = JSON.parse(text) as Settings;
    this.endpoint = settings.endpoint;
  }

  request(): string {
    return this.endpoint.toUpperCase();
  }
}
在试验场中打开
报告错误