-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.mjs
47 lines (40 loc) · 1.34 KB
/
index.mjs
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
import { Employee } from './classes/employee.mjs';
import { ISafetyCheck } from './classes/isafetycheck.mjs';
import { Test } from './classes/coronatest.mjs';
import { Cured } from './classes/cured.mjs';
import { Vaccination } from './classes/vaccination.mjs';
export function main() {
// write your own code here, to test your application
try {
const e = new Employee();
e.firstName = "Hans";
e.lastName = "Wurst"
const c1 = new Test();
c1.testDate = '2022-01-01';
e.addSafetyCheck(c1);
const c2 = new Vaccination();
c2.firstVaccination = "2022-01-01";
c2.secondVaccination = new Date("2022-12-01");
e.addSafetyCheck(c2);
const c3 = new Cured();
c3.dateOfDiagnosis = new Date("2022-06-01");
console.log(e.toString());
if (e.safetyChecks) {
console.log("checks:");
for (const c of e.safetyChecks) {
console.log(c.toString());
}
}
else {
console.log("no checks found");
}
} catch (e) {
console.log("there is still a lot to do");
console.error(e);
}
}
export { Employee, ISafetyCheck, Test, Cured, Vaccination }
import { pathToFileURL as _path } from 'url'
if (import.meta.url === _path(process.argv[1]).href) {
main();
}