@@ -621,56 +621,56 @@ describe('ref', () => {
621
621
type : 'any' ,
622
622
flags : {
623
623
allowOnly : true ,
624
- default : 'ref: a.b'
624
+ default : { type : 'ref' , key : ' a.b', path : [ 'a' , 'b' ] }
625
625
} ,
626
- invalids : [ 'context: b.c' ] ,
627
- valids : [ 'ref: a.b' ]
626
+ invalids : [ { type : 'context' , key : ' b.c', path : [ 'b' , 'c' ] } ] ,
627
+ valids : [ { type : 'ref' , key : ' a.b', path : [ 'a' , 'b' ] } ]
628
628
} ,
629
629
alternatives : [ {
630
- ref : 'ref: a.b' ,
630
+ ref : { type : 'ref' , key : ' a.b', path : [ 'a' , 'b' ] } ,
631
631
is : {
632
632
type : 'date' ,
633
633
rules : [
634
- { name : 'min' , arg : 'ref: a.b' } ,
635
- { name : 'max' , arg : 'ref: a.b' }
634
+ { name : 'min' , arg : { type : 'ref' , key : ' a.b', path : [ 'a' , 'b' ] } } ,
635
+ { name : 'max' , arg : { type : 'ref' , key : ' a.b', path : [ 'a' , 'b' ] } }
636
636
]
637
637
} ,
638
638
then : {
639
639
type : 'number' ,
640
- flags : { allowOnly : true , default : 'ref: a.b' , unsafe : false } ,
641
- valids : [ 'ref: a.b' ] ,
642
- invalids : [ 'context: b.c' , Infinity , - Infinity ] ,
640
+ flags : { allowOnly : true , default : { type : 'ref' , key : ' a.b', path : [ 'a' , 'b' ] } , unsafe : false } ,
641
+ valids : [ { type : 'ref' , key : ' a.b', path : [ 'a' , 'b' ] } ] ,
642
+ invalids : [ { type : 'context' , key : ' b.c', path : [ 'b' , 'c' ] } , Infinity , - Infinity ] ,
643
643
rules : [
644
- { name : 'min' , arg : 'ref: a.b' } ,
645
- { name : 'max' , arg : 'ref: a.b' } ,
646
- { name : 'greater' , arg : 'ref: a.b' } ,
647
- { name : 'less' , arg : 'ref: a.b' }
644
+ { name : 'min' , arg : { type : 'ref' , key : ' a.b', path : [ 'a' , 'b' ] } } ,
645
+ { name : 'max' , arg : { type : 'ref' , key : ' a.b', path : [ 'a' , 'b' ] } } ,
646
+ { name : 'greater' , arg : { type : 'ref' , key : ' a.b', path : [ 'a' , 'b' ] } } ,
647
+ { name : 'less' , arg : { type : 'ref' , key : ' a.b', path : [ 'a' , 'b' ] } }
648
648
]
649
649
} ,
650
650
otherwise : {
651
651
type : 'object' ,
652
- flags : { allowOnly : true , default : 'ref: a.b' } ,
653
- valids : [ 'ref: a.b' ] ,
654
- invalids : [ 'context: b.c' ] ,
652
+ flags : { allowOnly : true , default : { type : 'ref' , key : ' a.b', path : [ 'a' , 'b' ] } } ,
653
+ valids : [ { type : 'ref' , key : ' a.b', path : [ 'a' , 'b' ] } ] ,
654
+ invalids : [ { type : 'context' , key : ' b.c', path : [ 'b' , 'c' ] } ] ,
655
655
rules : [ {
656
656
name : 'assert' ,
657
657
arg : {
658
658
schema : {
659
659
type : 'any' ,
660
660
flags : { allowOnly : true } ,
661
- valids : [ 'ref: a.b' ]
661
+ valids : [ { type : 'ref' , key : ' a.b', path : [ 'a' , 'b' ] } ]
662
662
} ,
663
- ref : 'ref: a.b'
663
+ ref : { type : 'ref' , key : ' a.b', path : [ 'a' , 'b' ] }
664
664
}
665
665
} ] ,
666
666
children : {
667
667
a : {
668
668
type : 'string' ,
669
669
invalids : [ '' ] ,
670
670
rules : [
671
- { name : 'min' , arg : { limit : 'ref: a.b' } } ,
672
- { name : 'max' , arg : { limit : 'ref: a.b' } } ,
673
- { name : 'length' , arg : { limit : 'ref: a.b' } }
671
+ { name : 'min' , arg : { limit : { type : 'ref' , key : ' a.b', path : [ 'a' , 'b' ] } } } ,
672
+ { name : 'max' , arg : { limit : { type : 'ref' , key : ' a.b', path : [ 'a' , 'b' ] } } } ,
673
+ { name : 'length' , arg : { limit : { type : 'ref' , key : ' a.b', path : [ 'a' , 'b' ] } } }
674
674
]
675
675
}
676
676
} ,
0 commit comments