Skip to content

Commit 1a7f283

Browse files
committed
docs(spec): 更正测试头注释里的 CLI 路径归属 (#4971 / #5341)
os validate / os build 走的是 CLI 自己的 formatZodErrors,不是这里的 formatZodError;后者的实际到达面是 defineStack 的抛错。 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FTszibd6C8sUCCZnM4VcrL
1 parent 4ad5d45 commit 1a7f283

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

‎packages/spec/src/shared/error-map.test.ts‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -175,10 +175,12 @@ describe('formatZodError', () => {
175175
// string `"Invalid input"`; every branch's real rejection sits one level down
176176
// in `issue.errors[]`. Structural consumers (the REST error body,
177177
// `ZodError.message`) carry that payload through — a flatten-to-one-line
178-
// consumer does not, and `formatZodError` is exactly such a consumer, on the
179-
// CLI path (`os validate` / `os compile`). Until #4971 the curated prose the
178+
// consumer does not, and `formatZodError` is exactly such a consumer: it is
179+
// documented for CLI output and is what `defineStack` throws through, so every
180+
// author loading a stack config reads it. Until #4971 the curated prose the
180181
// #4001 campaign wrote for every strict shape behind a union was cut off
181-
// before it reached the author.
182+
// before it reached them. (`os validate` / `os build` print through the CLI's
183+
// OWN `formatZodErrors`, which still flattens the same way — #5341.)
182184
//
183185
// The whole risk of fixing it is the opposite failure: N branches × the same
184186
// mistake = the same key reported N times, which is why `view.zod.ts`'s

0 commit comments

Comments
 (0)