JSON import support

+ JSON import added
+ code structure refactored
This commit is contained in:
michal-kapala
2023-03-10 20:32:57 +01:00
parent c92fd20fbc
commit 63bf053c36
10 changed files with 556 additions and 194 deletions

View File

@ -6,9 +6,9 @@ import { CommonCSVReaderOptions } from "https://deno.land/x/csv@v0.8.0/reader.ts
export type ParserOptions = Partial<CommonCSVReaderOptions>;
/**
* Raw row object with string properties returned by `csv.readCSVObjects`.
* Raw CSV row returned by `csv.readCSVObjects`.
*/
export type RawRow = {
export type RawCsvRow = {
[key: string]: string;
};
@ -19,3 +19,9 @@ export type ParsedRow = {
// deno-lint-ignore no-explicit-any
[key: string]: any;
};
export type CsvOptions = {
delimiter: string;
lf: boolean;
quote: string;
};

7
types/json.ts Normal file
View File

@ -0,0 +1,7 @@
/**
* Raw JSON object returned by `JSON.parse`.
*/
export type RawJsonRow = {
// deno-lint-ignore no-explicit-any
[key: string]: any;
};