Skip to content

Commit

Permalink
Feat: report util (#506)
Browse files Browse the repository at this point in the history
* refactor: create class for transforming report to hierarchy structure for reusability

* feat: util to check if report is report or checkpoint

---------

Co-authored-by: MarkvdVorst <[email protected]>
  • Loading branch information
MatthijsSmets and MarkvdVorst authored Jul 15, 2024
1 parent 6a22f31 commit b9d3e0d
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/app/shared/util/report-util.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { Report } from '../interfaces/report';
import { Checkpoint } from '../interfaces/checkpoint';

export const ReportUtil = {
isReport(node: Report | Checkpoint): node is Report {
return !!(node as Report).xml;
},

isCheckPoint(node: Report | Checkpoint): node is Checkpoint {
return !!(node as Checkpoint).uid;
},
};

0 comments on commit b9d3e0d

Please sign in to comment.