File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -1244,7 +1244,7 @@ export interface Worksheet {
1244
1244
/**
1245
1245
* Get or create rows by 1-based index
1246
1246
*/
1247
- getRows ( start : number , length : number ) : Row [ ] ;
1247
+ getRows ( start : number , length : number ) : Row [ ] | undefined ;
1248
1248
1249
1249
/**
1250
1250
* Iterate over all rows that have values in a worksheet
Original file line number Diff line number Diff line change @@ -639,6 +639,13 @@ describe('Worksheet', () => {
639
639
expect ( count ) . to . equal ( 7 ) ;
640
640
} ) ;
641
641
642
+ it ( 'returns undefined when row range is less than 1' , ( ) => {
643
+ const wb = new ExcelJS . Workbook ( ) ;
644
+ const ws = wb . addWorksheet ( 'blort' ) ;
645
+
646
+ expect ( ws . getRows ( 1 , 0 ) ) . to . equal ( undefined ) ;
647
+ } ) ;
648
+
642
649
context ( 'when worksheet name is less than or equal 31' , ( ) => {
643
650
it ( 'save the original name' , ( ) => {
644
651
const wb = new ExcelJS . Workbook ( ) ;
You can’t perform that action at this time.
0 commit comments