Skip to content

Commit f9599d2

Browse files
committed
Extract deps from converter and Delete await keyword
1 parent afcd053 commit f9599d2

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

deps.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ export { Confirm, Input, Number } from "https://deno.land/x/cliffy@v0.25.4/promp
2727

2828
export { Sha1 } from "https://deno.land/std@0.146.0/hash/sha1.ts";
2929

30+
export { parse } from "https://deno.land/std@0.174.0/encoding/csv.ts";
31+
3032
export const zipWrapper = {
3133
decompress: _decompress,
3234
};

libs/postprocess/csv_to_json_converter.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import { parse } from "https://deno.land/std@0.174.0/encoding/csv.ts";
1+
import { parse } from "../../deps.ts";
22
import { Colors } from "../../deps.ts";
33
import { BasePostprocess } from "./base_postprocess.ts";
44

55
export class CsvToJsonConverter extends BasePostprocess {
66
async execute(_: string[], targetPath: string): Promise<string> {
77
const text = await Deno.readTextFile(targetPath);
8-
const result = await parse(text, { skipFirstRow: true });
8+
const result = parse(text, { skipFirstRow: true });
99
Deno.writeTextFileSync(targetPath.replace(/\.csv?$/, ".json"), JSON.stringify(result));
1010
return targetPath;
1111
}

0 commit comments

Comments
 (0)