Function: parseCsv()
parseCsv<
T>(content,schema,options?):StaticDecode<T>[]
Parse the CSV string according to the given schema
Type Parameters
| Type Parameter |
|---|
T extends TCsvSchema |
Parameters
| Parameter | Type | Description |
|---|---|---|
content | string | A string of CSV file content |
schema | T | Output schema mapping of each row |
options? | ParseOptions | - |
Returns
StaticDecode<T>[]
An array of given schema
Throws
If fail to parse the schema
Example
ts
const output = parseCsv('ID,Name\n1,A\n2,B\n', schema);