mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
11 lines
386 B
TypeScript
11 lines
386 B
TypeScript
import * as neatCsv from 'neat-csv';
|
|
|
|
const data: neatCsv.Input = 'type,part\nunicorn,horn\nrainbow,pink';
|
|
const options: neatCsv.Options = { separator: ',' };
|
|
|
|
neatCsv(data); // $ExpectType Promise<Row[]>
|
|
const rowsPromise = neatCsv(data, options); // $ExpectType Promise<Row[]>
|
|
|
|
rowsPromise.then(rows =>
|
|
rows.map(({ type, part }: neatCsv.Row) => `type: ${type}, part: ${part}`));
|