Skip to content

Commit e5b60c8

Browse files
committed
fix: removed unnessesary lines
1 parent 7264211 commit e5b60c8

File tree

3 files changed

+3
-19
lines changed

3 files changed

+3
-19
lines changed

src/Converter.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -93,14 +93,8 @@ export class Converter extends Transform implements PromiseLike<any[]> {
9393
this.params = mergeParams(param);
9494
this.runtime = initParseRuntime(this);
9595
this.result = new Result(this);
96-
// if (this.params.fork) {
97-
// this.processor = new ProcessorFork(this);
98-
// } else {
9996
this.processor = new ProcessorLocal(this);
100-
// }
10197
this.once("error", (err: any) => {
102-
// console.log("BBB");
103-
//wait for next cycle to emit the errors.
10498
setImmediate(() => {
10599
this.result.processError(err);
106100
this.emit("done", err);

src/lineToJson.ts

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@ import { Converter } from "./Converter";
22
import CSVError from "./CSVError";
33
import { CellParser, ColumnParam } from "./Parameters";
44
import set from "lodash/set";
5-
import { ParseRuntime } from "./ParseRuntime";
65

7-
var numReg = /^[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?$/;
6+
const numReg = /^[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?$/;
87

98
export default function (csvRows: string[][], conv: Converter): JSONResult[] {
109
const res: JSONResult[] = [];
@@ -58,10 +57,6 @@ function convertRowToJson(row: string[], headRow: string[], conv: Converter): {
5857
setPath(resultRow, head, convRes, conv,i);
5958
}
6059
} else {
61-
// var flag = getFlag(head, i, param);
62-
// if (flag === 'omit') {
63-
// continue;
64-
// }
6560
if (conv.parseParam.checkType) {
6661
const convertFunc = checkType(item, head, i, conv);
6762
item = convertFunc(item);
@@ -193,12 +188,8 @@ function dynamicType(item) {
193188
}
194189

195190
function booleanType(item) {
196-
var trimed = item.trim();
197-
if (trimed.length === 5 && trimed.toLowerCase() === "false") {
198-
return false;
199-
} else {
200-
return true;
201-
}
191+
const trimmed = item.trim();
192+
return !(trimmed.length === 5 && trimmed.toLowerCase() === "false");
202193
}
203194

204195
function jsonType(item) {

v2/lineToJson.js

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)