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

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy