type rowElement = string | number | boolean;
type row = rowElement[];
function parse(input: string, separator?: separator, quote?: string): row;
However, parse returns an array of rows.
Currently I'm getting errors because I try to do the following :
const header = parse(data)[0]
If I console.log(header) I have received an array of strings. However header is now implicitly typed as rowElement which means typescript sees it as a string | number | boolean
The return-type of parse seems incorrect.
The types are defined as follows:
However, parse returns an array of
rows
.Currently I'm getting errors because I try to do the following :
If I
console.log(header)
I have received an array of strings. However header is now implicitly typed asrowElement
which means typescript sees it as astring | number | boolean
You can check out an example here