Skip to content

[BUG] getSheetValues() typescript definition is incorrect #1254

Open
@danielnitsche

Description

@danielnitsche

🐛 Bug Report

Lib version: 3.9.0

Steps To Reproduce

getSheetValues() is defined as:

	/**
	 * return all rows as sparse array
	 */
	getSheetValues(): Row[];

So one would expect a Row type to be returned.

The expected behaviour:

However reviewing the code for this function:

  // return all rows as sparse array
  getSheetValues() {
    const rows = [];
    this._rows.forEach(row => {
      if (row) {
        rows[row.number] = row.values;
      }
    });
    return rows;
  }

A plain array is being returned instead.

Possible solution (optional, but very helpful):

Update type definition to

	/**
	 * return all rows as sparse array
	 */
	getSheetValues(): Cell[][];

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions