Skip to content

Commit 9a50037

Browse files
committed
fix(cli): widen formatPath signature to accept PropertyKey for zod compat
1 parent 60dac06 commit 9a50037

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/lib/validate.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,11 @@ function lookupValueSuggestion(path: string, issue: ZodIssue): string | undefine
7777
return undefined;
7878
}
7979

80-
function formatPath(parts: ReadonlyArray<string | number>): string {
80+
function formatPath(parts: ReadonlyArray<PropertyKey>): string {
8181
return parts.reduce<string>((acc, part) => {
8282
if (typeof part === "number") return `${acc}[${part}]`;
83-
return acc ? `${acc}.${part}` : part;
83+
const key = String(part);
84+
return acc ? `${acc}.${key}` : key;
8485
}, "");
8586
}
8687

0 commit comments

Comments
 (0)