diff --git a/package.json b/package.json index da59eeb..8218e97 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "async-convert-csv-to-json", - "version": "1.4.1", + "version": "1.4.2", "description": "convert csv file to json", "main": "index.js", "scripts": { diff --git a/utils/converter.js b/utils/converter.js index 2a00f2c..564ae66 100644 --- a/utils/converter.js +++ b/utils/converter.js @@ -6,8 +6,8 @@ const csvToJson = (csv) => { const result = []; const headers = lines[0].split(','); const contents = lines.slice(1, lines.length - 1) - const obj = {}; for (const content of contents) { + const obj = {}; const currentline = content.split(','); for (let j = 0; j < headers.length; j++) { obj[headers[j]] = currentline[j];