From a4fdedfcac02cb53608d9d3b9e96de0526140fd7 Mon Sep 17 00:00:00 2001 From: Kevin J Hoerr Date: Sun, 10 Nov 2019 14:34:18 -0500 Subject: Move TS files into /src --- src/formats.ts | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 src/formats.ts (limited to 'src/formats.ts') diff --git a/src/formats.ts b/src/formats.ts new file mode 100644 index 0000000..b5a24bf --- /dev/null +++ b/src/formats.ts @@ -0,0 +1,33 @@ +interface Format { + parse_coverage: (file: Document) => number; +} + +interface FormatList { + [key: string]: Format +} + +interface FormatObj { + formats: FormatList, + list_formats: () => string[], + get_format: (format: string) => Format, +} + +const FormatsObj: FormatObj = { + formats: { + tarpaulin: { + parse_coverage: (file: Document) => { + return 0.0; + } + }, + }, + + list_formats: function () { + return Object.keys(this.formats); + }, + + get_format: function (format: string) { + return this.formats[format]; + } +} + +export default FormatsObj; \ No newline at end of file -- cgit