blob: 8f3c10501091b24df95ca33c3bc393b32035a7d7 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
import { parseDatabase, parseLabSchedule, parsePTSchedule, parseQuestionnaireCSV, parseOfficeHours } from "../util/parser";
export async function parsePTFile(file: File) {
try {
const text = await file.text();
return parsePTSchedule(text);
} catch (error) {
console.error(file.name, error);
throw error;
}
}
export async function readQuestionnaire(file: File) {
try {
const text = await file.text();
return parseQuestionnaireCSV(text);
} catch (error) {
console.error(file.name, error);
throw error;
}
}
export async function parseOfficeHoursFile(file: File) {
try {
const text = await file.text();
return parseOfficeHours(text);
} catch (error) {
console.error(file.name, error);
throw error;
}
}
export async function parseLabScheduleFile(file: File) {
const text = await file.text();
try {
const labSchedule = JSON.parse(text);
return parseLabSchedule(labSchedule);
} catch (error) {
console.error(file.name, error);
throw error;
}
}
export async function parseDatabaseFile(file: File) {
const text = await file.text();
try {
const database = JSON.parse(text);
return parseDatabase(database);
} catch (error) {
console.error(file.name, error);
throw error;
}
}
|