Passed
Push — dev ( c71d4d...da46c8 )
by
unknown
05:00
created

resources/assets/js/components/AssessmentPlan/assessmentHelpers.ts   A

Complexity

Total Complexity 1
Complexity/F 0

Size

Lines of Code 14
Function Count 0

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 10
dl 0
loc 14
rs 10
c 0
b 0
f 0
wmc 1
mnd 1
bc 1
fnc 0
bpm 0
cpm 0
noi 0
1
import { Assessment } from "../../models/types";
2
3
const getUniqueAssessmentTypes = (assessments: Assessment[]): number[] => {
4
  const uniqueIds: number[] = [];
5
  assessments.forEach((assessment) => {
6
    if (!uniqueIds.includes(assessment.assessment_type_id)) {
7
      uniqueIds.push(assessment.assessment_type_id);
8
    }
9
  });
10
  return uniqueIds;
11
};
12
// eslint-disable-next-line import/prefer-default-export
13
export { getUniqueAssessmentTypes };
14