cmj5547
cmj55472y ago

Validator for object with dynamic keys

hi all, super impressed so far with convex, but quick question should I be allowed to do the following
args: {
member: v.object({
[v.string()]: v.array(v.string())
})
}
args: {
member: v.object({
[v.string()]: v.array(v.string())
})
}
for dynamic string keys in an object
1 Reply
Michal Srb
Michal Srb2y ago
Hi @cmj5547, for now we suggest to either use: v.array(v.object({key: v.string(), value: ...})) or v.any() We don't have validators for the equivalent of TypeScript Record or for "tuple"s yet.

Did you find this page helpful?