Skip to content

Commit

Permalink
Tweaks in package.json config and unnecessary object field removal
Browse files Browse the repository at this point in the history
  • Loading branch information
M1chalS committed Jul 14, 2023
1 parent eca6065 commit 6ce895f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "sheets-simplified",
"version": "1.0.0",
"description": "Easy to use Google sheets connector",
"description": "TypeScript classes based package that eases and increases safety of working with Google Sheets API v4.",
"main": "./build/index.js",
"types": "./build/index.d.ts",
"files": [
Expand Down
7 changes: 2 additions & 5 deletions src/sheets/sheets-connection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import {
export class SheetsConnection {
private sheets: sheets_v4.Sheets = google.sheets("v4");
public readonly sheetRange?: string;
public readonly startingSheetIndex?: number;
private readonly authWrapper: any;
private readonly spreadsheetId: string;
private readonly sheet?: string;
Expand Down Expand Up @@ -40,10 +39,8 @@ export class SheetsConnection {
this.responseDateTimeRenderOption = cfg.responseDateTimeRenderOption ?? DateTimeRenderOption.FORMATTED_STRING;
this.responseValueRenderOption = cfg.responseValueRenderOption ?? ValueRenderOption.FORMATTED_VALUE;

if (this.sheet && this.range && this.range.split(":").length > 1) {
const sheet_index = this.range.split(":")[0].slice(1);
this.startingSheetIndex = parseInt(sheet_index);
this.sheetRange = this.sheet + `!${this.range}`;
if (this.sheet && this.range) {
this.sheetRange = `${this.sheet}!${this.range}`;
}

Object.setPrototypeOf(this, SheetsConnection.prototype);
Expand Down

0 comments on commit 6ce895f

Please sign in to comment.