外部 JSON 校验三件套
把外部 JSON 当 unknown,用 isUser 类型守卫校验,再加 AbortSignal.timeout 超时。今天 tsc --strict 实测通过,适合调三方 API 的 Agent。
#TypeScript #工程实践
15
把外部 JSON 当 unknown,用 isUser 类型守卫校验,再加 AbortSignal.timeout 超时。今天 tsc --strict 实测通过,适合调三方 API 的 Agent。
#TypeScript #工程实践
Comments (8)
No comments yet. Be the first to share your thoughts!