You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
`The array item for the '${key}' must be one of the primitive types constructor: String, Number, or Boolean`,
610
+
stringifyModel(
611
+
Model,
612
+
`The array item for the '${key}' must be one of the primitive types constructor: String, Number, or Boolean`,
613
+
),
601
614
);
602
615
}
603
616
@@ -639,15 +652,21 @@ function setupModel(Model, nested) {
639
652
config.storage.offline.threshold
640
653
){
641
654
throwError(
642
-
`External nested model for '${key}' property has lower offline threshold (${localConfig.storage.offline.threshold} ms) than the parent definition (${config.storage.offline.threshold} ms)`,
655
+
stringifyModel(
656
+
Model,
657
+
`External nested model for '${key}' property has lower offline threshold (${localConfig.storage.offline.threshold} ms) than the parent definition (${config.storage.offline.threshold} ms)`,
658
+
),
643
659
);
644
660
}
645
661
646
662
if(localConfig.enumerable&&defaultValue[1]){
647
663
constnestedOptions=defaultValue[1];
648
664
if(typeofnestedOptions!=="object"){
649
665
throwTypeError(
650
-
`Options for '${key}' array property must be an object instance: ${typeofnestedOptions}`,
666
+
stringifyModel(
667
+
Model,
668
+
`Options for '${key}' array property must be an object instance: ${typeofnestedOptions}`,
669
+
),
651
670
);
652
671
}
653
672
if(nestedOptions.loose){
@@ -675,12 +694,6 @@ function setupModel(Model, nested) {
675
694
};
676
695
}
677
696
678
-
if(Object.keys(defaultValue).length===0){
679
-
throwTypeError(
680
-
`The object for the '${key}' must have at least one property`,
@@ -690,7 +703,10 @@ function setupModel(Model, nested) {
690
703
config.storage.offline.threshold
691
704
){
692
705
throwError(
693
-
`External nested model for '${key}' property has lower offline threshold (${nestedConfig.storage.offline.threshold} ms) than the parent definition (${config.storage.offline.threshold} ms)`,
706
+
stringifyModel(
707
+
Model,
708
+
`External nested model for '${key}' property has lower offline threshold (${nestedConfig.storage.offline.threshold} ms) than the parent definition (${config.storage.offline.threshold} ms)`,
709
+
),
694
710
);
695
711
}
696
712
return(model,data,lastModel)=>{
@@ -757,6 +773,7 @@ function setupModel(Model, nested) {
757
773
};
758
774
}
759
775
case"record": {
776
+
parentModels.set(defaultValue,Model);
760
777
constlocalConfig=bootstrap(defaultValue,true);
761
778
762
779
return(model,data,lastModel)=>{
@@ -772,7 +789,10 @@ function setupModel(Model, nested) {
772
789
773
790
if(typeofdata[key]!=="object"){
774
791
throwTypeError(
775
-
`The value for the '${key}' must be an object instance: ${typeofdata[key]}`,
792
+
stringifyModel(
793
+
Model,
794
+
`The value for the '${key}' must be an object instance: ${typeofdata[key]}`,
795
+
),
776
796
);
777
797
}
778
798
@@ -799,13 +819,13 @@ function setupModel(Model, nested) {
0 commit comments