New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@mduan/gsheet-utils

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mduan/gsheet-utils - npm Package Compare versions

Comparing version 1.0.22 to 1.0.23

2

package.json
{
"name": "@mduan/gsheet-utils",
"version": "1.0.22",
"version": "1.0.23",
"description": "",

@@ -5,0 +5,0 @@ "main": "src/index.ts",

@@ -124,2 +124,20 @@ import isEqual from 'lodash/isEqual';

export function getRangeFormulasOrValues(
headerRangeOrName: RangeOrName,
options: SpreadsheetOptions = {},
): SpreadsheetDataType[][] {
const range = getRange(headerRangeOrName, getSpreadsheetOptions(options));
const formulas = range.getFormulas();
const values = range.getValues();
const output: SpreadsheetDataType[][] = [];
for (let rowIdx = 0; rowIdx < range.getNumRows(); rowIdx += 1) {
const outputRow: SpreadsheetDataType[] = [];
for (let columnIdx = 0; columnIdx < range.getNumColumns(); columnIdx += 1) {
outputRow.push(formulas[rowIdx][columnIdx] ?? values[rowIdx][columnIdx]);
}
output.push(outputRow);
}
return output;
}
// TODO: property type return values (e.g. besides string, can also be Date/number)

@@ -136,7 +154,5 @@ export function getColumnValues(

const range = getRange(headerRangeOrName, getSpreadsheetOptions(options));
const values: SpreadsheetDataType[] = range
.getSheet()
.getRange(2, range.getColumn(), count !== null ? count : maxRows, 1)
.getValues()
.map((row: SpreadsheetDataType[]) => row[0]);
const values: SpreadsheetDataType[] = getRangeFormulasOrValues(
range.getSheet().getRange(2, range.getColumn(), count !== null ? count : maxRows, 1),
).map((row: SpreadsheetDataType[]) => row[0]);

@@ -177,5 +193,3 @@ if (Number.isFinite(count)) {

const sheet = rangeSheets[0];
const rowValues: SpreadsheetDataType[][] = sheet
.getRange(2, 1, maxRows, maxColumn)
.getValues()
const rowValues: SpreadsheetDataType[][] = getRangeFormulasOrValues(sheet.getRange(2, 1, maxRows, maxColumn))
.map((row: SpreadsheetDataType[]) => {

@@ -182,0 +196,0 @@ return rangeColumns.map((rangeColumn) => row[rangeColumn - 1]);

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc