File tree 1 file changed +14
-2
lines changed
npm-packages/convex/src/values 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -458,7 +458,8 @@ export class VRecord<
458
458
get json ( ) : ValidatorJSON {
459
459
return {
460
460
type : this . kind ,
461
- keys : this . key . json ,
461
+ // This cast is needed because TypeScript thinks the key type is too wide
462
+ keys : this . key . json as RecordKeyValidatorJSON ,
462
463
values : {
463
464
fieldType : this . value . json ,
464
465
optional : false ,
@@ -630,6 +631,17 @@ export type ValidatorJSON =
630
631
| { type : "literal" ; value : JSONValue }
631
632
| { type : "id" ; tableName : string }
632
633
| { type : "array" ; value : ValidatorJSON }
633
- | { type : "record" ; keys : ValidatorJSON ; values : ObjectFieldType }
634
+ | {
635
+ type : "record" ;
636
+ keys : RecordKeyValidatorJSON ;
637
+ values : RecordValueValidatorJSON ;
638
+ }
634
639
| { type : "object" ; value : Record < string , ObjectFieldType > }
635
640
| { type : "union" ; value : ValidatorJSON [ ] } ;
641
+
642
+ type RecordKeyValidatorJSON =
643
+ | { type : "string" }
644
+ | { type : "id" ; tableName : string }
645
+ | { type : "union" ; value : RecordKeyValidatorJSON [ ] } ;
646
+
647
+ type RecordValueValidatorJSON = ObjectFieldType & { optional : false } ;
You can’t perform that action at this time.
0 commit comments