Skip to content

Commit

Permalink
simplify ckl mapper helper function
Browse files Browse the repository at this point in the history
Signed-off-by: Kaden Emley <[email protected]>
  • Loading branch information
kemley76 committed Jul 10, 2024
1 parent 23a8cc0 commit 0292f89
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions libs/hdf-converters/src/ckl-mapper/checklist-jsonix-converter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -680,7 +680,7 @@ export class ChecklistJsonixConverter extends JsonixIntermediateConverter<
// to be stored in the hdfSpecificData
const computedImpact = this.computeImpact(severityTag, severityOverrideTag);
if (
((computedImpact !== null && computedImpact !== impact) ||
((computedImpact !== undefined && computedImpact !== impact) ||
impact < 0.1 ||
impact >= 0.9) &&
impact !== 0.0
Expand Down Expand Up @@ -711,16 +711,11 @@ export class ChecklistJsonixConverter extends JsonixIntermediateConverter<
computeImpact(
severityTag: string | null,
severityOverrideTag: string | null
): number | null {
): number | undefined {
let computedSeverity = severityTag;
if (severityOverrideTag) computedSeverity = severityOverrideTag;
computedSeverity = computedSeverity?.toLowerCase() ?? null;
if (
computedSeverity &&
(severities as readonly string[]).includes(computedSeverity)
)
return impactMapping(IMPACT_MAPPING)(computedSeverity);
return null;
if (computedSeverity) return IMPACT_MAPPING.get(computedSeverity);
}

addHdfProfileSpecificData(profile: ExecJSON.Profile): string {
Expand Down

0 comments on commit 0292f89

Please sign in to comment.