I'm exploring Deno with cvs files, but i got a problem with the parse. I'm thinking that the problem come with the old dependencies;
deno info --unstable --no-check .\mod.ts
The majority are from @0.75 and I'm in the @1.5.
And I want to collaborate to help to solve problems in the Deno repo and not just downgrade to some stable version.
I'm using:
deno 1.5.0
v8 8.7.220.3
typescript 4.0.
I'm having having issue with this code:
import { join } from "https://deno.land/std/path/mod.ts";
import { parse } from "https://deno.land/std/encoding/csv.ts";
import { BufReader } from "https://deno.land/std/io/bufio.ts";
async function loadData() {
const path = join(".", "data.csv");
const file = await Deno.open(path);
const bufReader = new BufReader(file);
const result = await parse(bufReader, {
skipFirstRow: true,
comment: "#",
});
Deno.close(file.rid)
console.log(result)
}
await loadData();
The error:
error: TS2345 [ERROR]: Argument of type 'BufReader' is not assignable to parameter of type 'string | BufReader'.
Type 'import("https://deno.land/std/io/bufio.ts").BufReader' is not assignable to
type 'import("https://deno.land/std@0.75.0/io/bufio.ts").BufReader'.
Types have separate declarations of a private property 'buf'.
const result = await parse(bufReader, {
~~~~~~~~~
at...