Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions lib/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,10 @@ function safeAccess(obj: Record<string, any>, path: string) {
if (Number.isNaN(parsedIndex)) return undefined;
return arrayValue[parsedIndex];
}
// If current value is an array and we're accessing a named property, use the first element
if (Array.isArray(acc)) {
return acc[0]?.[part];
}
return acc && acc[part];
}, obj);
}
Expand Down