@teko-builder/utils
Advanced tools
Comparing version 0.1.4 to 0.1.5
@@ -162,3 +162,3 @@ import pino from 'pino'; | ||
logger.error(err); | ||
return err.response ? err.response : { code: 404 }; | ||
return err; | ||
} | ||
@@ -177,5 +177,11 @@ }; | ||
const sheet1 = doc.sheetsByIndex[0]; | ||
if (!sheet1.headerValues) { | ||
await sheet1.loadHeaderRow(); | ||
const headers = sheet1.headerValues; | ||
if (!headers) { | ||
await sheet1.setHeaderRow(Object.keys(body)); | ||
} | ||
else { | ||
const newHeaders = Object.keys(body).filter((el) => !headers.includes(el)); | ||
await sheet1.setHeaderRow([...headers, ...newHeaders]); | ||
} | ||
const validData = Object.values(body).filter(Boolean).length >= 1; | ||
@@ -182,0 +188,0 @@ if (validData) { |
@@ -171,3 +171,3 @@ 'use strict'; | ||
logger.error(err); | ||
return err.response ? err.response : { code: 404 }; | ||
return err; | ||
} | ||
@@ -186,5 +186,11 @@ }; | ||
const sheet1 = doc.sheetsByIndex[0]; | ||
if (!sheet1.headerValues) { | ||
await sheet1.loadHeaderRow(); | ||
const headers = sheet1.headerValues; | ||
if (!headers) { | ||
await sheet1.setHeaderRow(Object.keys(body)); | ||
} | ||
else { | ||
const newHeaders = Object.keys(body).filter((el) => !headers.includes(el)); | ||
await sheet1.setHeaderRow([...headers, ...newHeaders]); | ||
} | ||
const validData = Object.values(body).filter(Boolean).length >= 1; | ||
@@ -191,0 +197,0 @@ if (validData) { |
{ | ||
"name": "@teko-builder/utils", | ||
"version": "0.1.4", | ||
"version": "0.1.5", | ||
"description": "Utility functions", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -0,0 +0,0 @@ { |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
22469
17
498