nested_json_to_csv
Advanced tools
Comparing version 2.0.1 to 2.0.2
export interface IParser { | ||
parse(...args: any): any; | ||
get(): any; | ||
} | ||
@@ -8,2 +9,2 @@ | ||
hasId?: boolean; | ||
}; | ||
}; |
{ | ||
"name": "nested_json_to_csv", | ||
"version": "2.0.1", | ||
"version": "2.0.2", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "build/src/index.js", |
@@ -6,3 +6,3 @@ import { IParser } from "../../interfaces/IParser"; | ||
#csv: Csv; | ||
constructor(csv: Csv) { | ||
@@ -17,2 +17,5 @@ this.#csv = csv; | ||
} | ||
get() { | ||
return this.#csv; | ||
} | ||
#mapToJson(mp: Map<any, any>, json: any): any { | ||
@@ -38,6 +41,4 @@ Array.from(mp.entries()).forEach(([key, value]) => { | ||
}); | ||
if(rows.length > 1) | ||
mp.set(row[0], tempMp); | ||
else | ||
mp = new Map<any,any>(tempMp.entries()); | ||
if (rows.length > 1) mp.set(row[0], tempMp); | ||
else mp = new Map<any, any>(tempMp.entries()); | ||
}); | ||
@@ -44,0 +45,0 @@ return mp; |
@@ -42,3 +42,3 @@ import { isBooleanObject, isNumberObject, isStringObject } from "util/types"; | ||
} | ||
getData() { | ||
get() { | ||
return this.#data; | ||
@@ -45,0 +45,0 @@ } |
@@ -15,3 +15,3 @@ import { IFactory } from "../interfaces/IFactory"; | ||
const json = parser.parse(); | ||
const eJson = { | ||
@@ -31,3 +31,3 @@ name: "fox", | ||
const json = parser.parse(); | ||
const eJson = { | ||
@@ -47,3 +47,3 @@ "31245323": { name: "fox", id: "31245323" }, | ||
const json = parser.parse(); | ||
const eJson = { | ||
@@ -50,0 +50,0 @@ user: { |
65465
1401