@@ -521,7 +521,8 @@ test('positionBy() supports multi-root documents', () => {
521
521
}
522
522
}
523
523
524
- equal ( a . positionBy ( { index : 0 } ) , { column : 8 , line : 1 , offset : 7 } ) // `offset` is present because the `0` index returns `source.start`
524
+ // `offset` is present because the `0` index returns `source.start`
525
+ equal ( a . positionBy ( { index : 0 } ) , { column : 8 , line : 1 , offset : 7 } )
525
526
equal ( a . positionBy ( { index : 1 } ) , { column : 9 , line : 1 } )
526
527
equal ( a . positionBy ( { word : 'a' } ) , { column : 8 , line : 1 } )
527
528
} )
@@ -542,9 +543,9 @@ test('rangeBy() returns range for word when offsets are missing', () => {
542
543
let one = a . first as Declaration
543
544
544
545
// @ts -expect-error
545
- if ( one . source ?. start ) delete one . source . start . offset ;
546
+ if ( one . source ?. start ) delete one . source . start . offset
546
547
// @ts -expect-error
547
- if ( one . source ?. end ) delete one . source . end . offset ;
548
+ if ( one . source ?. end ) delete one . source . end . offset
548
549
549
550
equal ( one . rangeBy ( { word : 'one' } ) , {
550
551
end : { column : 9 , line : 1 } ,
@@ -586,13 +587,13 @@ test('rangeBy() returns range for word even after AST mutations when offsets are
586
587
let two = one . next ( ) as Declaration
587
588
588
589
// @ts -expect-error
589
- if ( a . source ?. start ) delete a . source . start . offset ;
590
+ if ( a . source ?. start ) delete a . source . start . offset
590
591
// @ts -expect-error
591
- if ( a . source ?. end ) delete a . source . end . offset ;
592
+ if ( a . source ?. end ) delete a . source . end . offset
592
593
// @ts -expect-error
593
- if ( two . source ?. start ) delete two . source . start . offset ;
594
+ if ( two . source ?. start ) delete two . source . start . offset
594
595
// @ts -expect-error
595
- if ( two . source ?. end ) delete two . source . end . offset ;
596
+ if ( two . source ?. end ) delete two . source . end . offset
596
597
597
598
equal ( a . rangeBy ( { word : 'two' } ) , {
598
599
end : { column : 5 , line : 3 } ,
@@ -631,9 +632,9 @@ test('rangeBy() returns range for index and endIndex when offsets are missing',
631
632
let one = a . first as Declaration
632
633
633
634
// @ts -expect-error
634
- if ( one . source ?. start ) delete one . source . start . offset ;
635
+ if ( one . source ?. start ) delete one . source . start . offset
635
636
// @ts -expect-error
636
- if ( one . source ?. end ) delete one . source . end . offset ;
637
+ if ( one . source ?. end ) delete one . source . end . offset
637
638
638
639
equal ( one . rangeBy ( { endIndex : 3 , index : 1 } ) , {
639
640
end : { column : 9 , line : 1 } ,
0 commit comments