object-to-google-spreadsheet
Advanced tools
Comparing version 1.0.5 to 1.0.6
@@ -8,4 +8,7 @@ const ArrayToGoogleSheets = require('array-to-google-sheets'); | ||
// a function the checks if input is array, stringifies accordingly | ||
const b = inp => inp instanceof Array ? inp.join(", ") : inp | ||
// extracting the field names from the object | ||
[obj.forEach(x => Object.keys(x[prop]).forEach(y => firstRowSet.add(y)))]; | ||
obj.forEach(x => Object.keys(x[prop]).forEach(y => firstRowSet.add(y))); | ||
@@ -22,3 +25,3 @@ // converting the field names set into an array | ||
// mapping the values into their corresponding rows | ||
const fillData = obj.map(x => head.map(y => y == a1 ? x[rowName] : x[prop][y] ? x[prop][y] : false)); | ||
const fillData = obj.map(x => head.map(y => y == a1 ? x[rowName] : x[prop][y] ? b(x[prop][y]) : false)); | ||
@@ -25,0 +28,0 @@ |
{ | ||
"name": "object-to-google-spreadsheet", | ||
"version": "1.0.5", | ||
"version": "1.0.6", | ||
"description": "Push an array of unstructured data objects into a Google spreadsheet", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -19,7 +19,8 @@ Quickly publish a set of unstructured JSON objects into a Google spreadsheet that you specify. | ||
const options = { | ||
sheetName: 'My Awesome Report', // sheet name | ||
sheetName: 'My Awesome Report', | ||
rowName: 'person', // the key name of the base of your rows | ||
properties: 'properties', // the name of the array of objects containing your base's properties | ||
properties: 'properties', // the array of objects containing your base's properties | ||
a1Field: 'details', // the value of the A1 field | ||
sort: true // sort fields | ||
sort: true, // sort fields | ||
removeBase: false // if true, the base column won't be rendered in the sheet | ||
} | ||
@@ -40,3 +41,3 @@ | ||
Age : 24, | ||
Hobbies : "swimming" | ||
Hobbies : ["swimming", "Javascripting"] | ||
} | ||
@@ -56,3 +57,3 @@ | ||
 | ||
 | ||
@@ -62,3 +63,3 @@ | ||
- Every Google Sheets has a unique key in the URL | ||
- Every Google Sheet has a unique key in the URL | ||
- https://docs.google.com/spreadsheets/d/{docKey}/ | ||
@@ -65,0 +66,0 @@ |
6409
48
87