@@ -21,17 +21,19 @@ describe('getBy', () => {
2121 mother : {
2222 name : 'Lisa' ,
2323 } ,
24- siblings : [ {
25- name : undefined
26- } ]
24+ siblings : [
25+ {
26+ name : undefined ,
27+ } ,
28+ ] ,
2729 }
2830
2931 it ( 'should get subfields by path' , ( ) => {
30- const name = getBy ( structure , 'name' ) ;
32+ const name = getBy ( structure , 'name' )
3133 expect ( name . value ) . toBe ( structure . name )
3234 expect ( name . found ) . toBe ( true )
3335
34- const motherName = getBy ( structure , 'mother.name' ) ;
36+ const motherName = getBy ( structure , 'mother.name' )
3537 expect ( motherName . value ) . toBe ( structure . mother . name )
3638 expect ( motherName . found ) . toBe ( true )
3739 } )
@@ -47,22 +49,18 @@ describe('getBy', () => {
4749 } )
4850
4951 it ( 'should get nested array subfields by path' , ( ) => {
50- const hobbies0 = getBy ( structure , 'kids[0].hobbies[0]' ) ;
51- expect ( hobbies0 . value ) . toBe (
52- structure . kids [ 0 ] ! . hobbies [ 0 ] ,
53- )
52+ const hobbies0 = getBy ( structure , 'kids[0].hobbies[0]' )
53+ expect ( hobbies0 . value ) . toBe ( structure . kids [ 0 ] ! . hobbies [ 0 ] )
5454 expect ( hobbies0 . found ) . toBe ( true )
5555
56- const hobbies1 = getBy ( structure , 'kids[0].hobbies[1]' ) ;
57- expect ( hobbies1 . value ) . toBe (
58- structure . kids [ 0 ] ! . hobbies [ 1 ] ,
59- )
56+ const hobbies1 = getBy ( structure , 'kids[0].hobbies[1]' )
57+ expect ( hobbies1 . value ) . toBe ( structure . kids [ 0 ] ! . hobbies [ 1 ] )
6058 expect ( hobbies1 . found ) . toBe ( true )
6159 } )
6260
6361 it ( 'should differentiate between explicit undefined vs. no path' , ( ) => {
64- const sibling0 = getBy ( structure , 'siblings[0].name' ) ;
65- const sibling1 = getBy ( structure , 'siblings[1].name' ) ;
62+ const sibling0 = getBy ( structure , 'siblings[0].name' )
63+ const sibling1 = getBy ( structure , 'siblings[1].name' )
6664
6765 expect ( sibling0 . value ) . toBeUndefined ( )
6866 expect ( sibling1 . value ) . toBeUndefined ( )
0 commit comments