Skip to content

Commit

Permalink
Style change according to review
Browse files Browse the repository at this point in the history
  • Loading branch information
LeoFrachet committed Dec 29, 2017
1 parent 919dcd8 commit a922794
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion helpers/csv.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ function fromCsvStringToArray(string, tableName) {
return null;
}

if (string.includes('"') === false) {
if (!string.includes('"')) {
return string.split(',');
}

Expand Down
6 changes: 3 additions & 3 deletions helpers/import.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ function getRows(buffer, regexPatternObjectsByTableName, tableName) {
const rows = [];
let rowsSlice;
let position = 0;
const length = 50000;
const batchLength = 50000;
let merge;
const regexPatternObjects = regexPatternObjectsByTableName[tableName];

while (position < buffer.length) {
rowsSlice = buffer.toString('utf8', position, Math.min(buffer.length, position + length));
rowsSlice = buffer.toString('utf8', position, Math.min(buffer.length, position + batchLength));

if (regexPatternObjects) {
regexPatternObjects.forEach((regexPatternObject) => {
Expand All @@ -64,7 +64,7 @@ function getRows(buffer, regexPatternObjectsByTableName, tableName) {
});

merge = rowsSlice[rowsSlice.length] !== '\n';
position += length;
position += batchLength;
}

return rows;
Expand Down

0 comments on commit a922794

Please sign in to comment.