sf-i-events 1.0.879 → 1.0.880

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/src/util.ts CHANGED
@@ -409,7 +409,7 @@ function parseCsv(csv:string){
409
409
  matches[2] !== undefined ? matches[2].replace(/""/g, '"') : matches[3]
410
410
  )
411
411
  }
412
- console.log('csv arr result', result, result.length);
412
+ // console.log('csv arr result', result, result.length);
413
413
  let csvResult = arrayToObject(result)
414
414
  return csvResult
415
415
  }
@@ -423,10 +423,10 @@ function arrayToObject (csvArray:any) {
423
423
  return csvArray.filter((row:any)=>{
424
424
  console.log('csv object keys lngth', Object.keys(row).length)
425
425
  return Object.keys(row).length > 1
426
- }).map((row: { [x: string]: any; }, index: number ) =>{
426
+ }).map((row: { [x: string]: any; } ) =>{
427
427
 
428
428
  return headers.reduce((acc: any, currentHeader: any, i: string | number) => {
429
- console.log('parsing row', row[i], index);
429
+ // console.log('parsing row', row[i], index);
430
430
  return((currentHeader.indexOf('cols_') >= 0 || currentHeader == '') ? acc : ((row[i] != '' && row[i] != null) ? { ...acc, ...{ [currentHeader]: JSON.parse(row[i] == "TRUE" ? "true" : row[i])}} : acc))
431
431
  }, {})
432
432
  })
package/util.js CHANGED
@@ -343,7 +343,7 @@ function parseCsv(csv) {
343
343
  result.push([]);
344
344
  result[result.length - 1].push(matches[2] !== undefined ? matches[2].replace(/""/g, '"') : matches[3]);
345
345
  }
346
- console.log('csv arr result', result, result.length);
346
+ // console.log('csv arr result', result, result.length);
347
347
  let csvResult = arrayToObject(result);
348
348
  return csvResult;
349
349
  }
@@ -354,9 +354,9 @@ function arrayToObject(csvArray) {
354
354
  return csvArray.filter((row) => {
355
355
  console.log('csv object keys lngth', Object.keys(row).length);
356
356
  return Object.keys(row).length > 1;
357
- }).map((row, index) => {
357
+ }).map((row) => {
358
358
  return headers.reduce((acc, currentHeader, i) => {
359
- console.log('parsing row', row[i], index);
359
+ // console.log('parsing row', row[i], index);
360
360
  return ((currentHeader.indexOf('cols_') >= 0 || currentHeader == '') ? acc : ((row[i] != '' && row[i] != null) ? { ...acc, ...{ [currentHeader]: JSON.parse(row[i] == "TRUE" ? "true" : row[i]) } } : acc));
361
361
  }, {});
362
362
  });