mirror of
https://github.com/janishutz/fundamentals-of-webengineering.git
synced 2026-01-08 07:58:23 +01:00
Rendering engine, simple refs almost complete, list refs start
This commit is contained in:
1 parent
ab5ec766e0
commit
7263ae6f5f
4 files changed
+172
-10
No files matched your search
+7
-4
@@ -1,12 +1,15 @@
|
||||
import {
|
||||
CSV_Data
|
||||
} from './types';
|
||||
import {
|
||||
csv2json
|
||||
} from 'json-2-csv';
|
||||
|
||||
export type CSV_Data = Array<Record<string, unknown>>;
|
||||
|
||||
const convertCSVtoJSON = async ( csvText: string ) => {
|
||||
// Type cast OK, as the typing of the external library is not perfect.
|
||||
// NOTE: On transpilation to JS, it will be (more or less) disregarded anyway
|
||||
// Type cast OK, as the typing of the external library is not perfect -> Actually it is.
|
||||
// NOTE: On transpilation to JS, it will be (more or less) disregarded anyway.
|
||||
// If you claim it isn't good typing, it's the same as expecting it to guess the typing,
|
||||
// which is literally impossible in TS. But sure...
|
||||
return ( await csv2json( csvText ) ) as CSV_Data;
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user