New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

conversikit

Package Overview
Dependencies
Maintainers
1
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

conversikit - npm Package Compare versions

Comparing version 1.8.3 to 1.8.4

55

index.js

@@ -156,23 +156,60 @@ const fs = require('fs').promises;

}
let data = await fs.readFile(path, 'utf8');
// console.log("data ==== ", data)
// Split the CSV data into an array of rows
const rows = data.split('\n');
const header = rows[0];
const header = rows[0].split(',');
//let create a json data for this csv file
let jsonArray = [];
for (let i = 1; i < rows.length; i++) {
for (let i = 0; i < rows.length; i++) {
let csvData = rows[i].split(',');
// console.log("csvData == ", csvData)
let obj = {};
for (let j = 0; j < header.length; j++) {
if (header.split(",")[j]) {
obj[header.split(",")[j]] = csvData[j] || "";
let concatData = "";
let dataOccur = 0;
let occure = false;
for (let j = 0; j < csvData.length; j++) {
// console.log("==========================================================")
// console.log("csvData length === ", csvData.length);
// console.log("data occure = ", dataOccur);
// console.log("header length = ", header[j - dataOccur])
// console.log("--------------------------------------------------------")
if (occure) {
if (csvData[j].endsWith('"')) {
concatData += csvData[j];
obj[header[j - dataOccur]] = concatData || "";
concatData = "";
occure = false;
} else {
dataOccur++;
concatData += csvData[j] + ",";
}
continue;
}
if (csvData[j].startsWith('"')) {
// console.log("data == ", csvData[j])
concatData += csvData[j] + ",";
dataOccur++;
occure = true;
// console.log("oc json -- ", obj);
continue;
}
if (header[j - dataOccur]) {
obj[header[j - dataOccur]] = csvData[j] || "";
}
// console.log("ppp json -- ", obj);
}
if (obj) jsonArray.push(obj)
}
// console.log("allll -------> ", jsonArray)
return jsonArray;
} catch (error) {

@@ -179,0 +216,0 @@ throw error;

2

package.json
{
"name": "conversikit",
"version": "1.8.3",
"version": "1.8.4",
"description": "convert anything",

@@ -5,0 +5,0 @@ "main": "index.js",

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