Skip to content

Commit

Permalink
fix: removed unnessesary lines
Browse files Browse the repository at this point in the history
  • Loading branch information
dogabudak committed Apr 18, 2023
1 parent 7264211 commit e5b60c8
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 19 deletions.
6 changes: 0 additions & 6 deletions src/Converter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,14 +93,8 @@ export class Converter extends Transform implements PromiseLike<any[]> {
this.params = mergeParams(param);
this.runtime = initParseRuntime(this);
this.result = new Result(this);
// if (this.params.fork) {
// this.processor = new ProcessorFork(this);
// } else {
this.processor = new ProcessorLocal(this);
// }
this.once("error", (err: any) => {
// console.log("BBB");
//wait for next cycle to emit the errors.
setImmediate(() => {
this.result.processError(err);
this.emit("done", err);
Expand Down
15 changes: 3 additions & 12 deletions src/lineToJson.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@ import { Converter } from "./Converter";
import CSVError from "./CSVError";
import { CellParser, ColumnParam } from "./Parameters";
import set from "lodash/set";
import { ParseRuntime } from "./ParseRuntime";

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

export default function (csvRows: string[][], conv: Converter): JSONResult[] {
const res: JSONResult[] = [];
Expand Down Expand Up @@ -58,10 +57,6 @@ function convertRowToJson(row: string[], headRow: string[], conv: Converter): {
setPath(resultRow, head, convRes, conv,i);
}
} else {
// var flag = getFlag(head, i, param);
// if (flag === 'omit') {
// continue;
// }
if (conv.parseParam.checkType) {
const convertFunc = checkType(item, head, i, conv);
item = convertFunc(item);
Expand Down Expand Up @@ -193,12 +188,8 @@ function dynamicType(item) {
}

function booleanType(item) {
var trimed = item.trim();
if (trimed.length === 5 && trimed.toLowerCase() === "false") {
return false;
} else {
return true;
}
const trimmed = item.trim();
return !(trimmed.length === 5 && trimmed.toLowerCase() === "false");
}

function jsonType(item) {
Expand Down
1 change: 0 additions & 1 deletion v2/lineToJson.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit e5b60c8

Please sign in to comment.