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.15 to 1.0.16

2

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

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

import isEqual from 'lodash/isEqual';
import max from 'lodash/max';
import pick from 'lodash/pick';

@@ -123,3 +124,3 @@ import uniqWith from 'lodash/uniqWith';

options: {count?: number | null} & SpreadsheetOptions = {},
): string[] {
): SpreadsheetDataType[] {
const {count = null} = options;

@@ -131,7 +132,7 @@ if (count === 0) {

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

@@ -154,3 +155,2 @@ if (Number.isFinite(count)) {

// TODO: Look into merging this with getColumnValues()
// Get values for multiple columns, where main column is required

@@ -163,5 +163,20 @@ export function getMultiColumnValues(

const headers = [...requiredColumnHeaders, ...optionalColumnHeaders];
const valuesList: string[][] = headers.map((header) => getColumnValues(header, {count: maxRows, ...options}));
const rowTuples = zip(...valuesList)
const ranges = headers.map((header) => getRange(header, getSpreadsheetOptions(options)));
const rangeSheets = ranges.map((range) => range.getSheet());
const numUniqueSheets = new Set(rangeSheets.map((sheet) => sheet.getName())).size;
if (numUniqueSheets !== 1) {
throw new Error(`All ranges should be on the same sheet: rangeSheets=${JSON.stringify(rangeSheets)}`);
}
const rangeColumns = ranges.map((range) => range.getColumn())
const maxColumn = max(rangeColumns)!;
const sheet = rangeSheets[0];
const rowValues: SpreadsheetDataType[][] = sheet
.getRange(2, 1, maxRows, maxColumn)
.getValues()
.map((row: SpreadsheetDataType[]) => {
return rangeColumns.map((rangeColumn) => row[rangeColumn - 1]);
});
const rowTuples = rowValues
.filter((rowValues) => {

@@ -168,0 +183,0 @@ return rowValues.slice(0, requiredColumnHeaders.length).every((requiredValue) => Boolean(requiredValue));

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