All files / app/codeCharta/ui/ribbonBar/searchPanel/mapTreeView areaMetricValidPipe.pipe.ts

100% Statements 7/7
100% Branches 10/10
100% Functions 2/2
100% Lines 5/5

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 187x               7x   134x       7x 382x    
import { Pipe, PipeTransform } from "@angular/core"
 
import { CodeMapNode } from "../../../../codeCharta.model"
 
@Pipe({
    name: "areaMetricValid",
    standalone: true
})
export class AreaMetricValidPipe implements PipeTransform {
    transform(node: CodeMapNode, areaMetric: string): boolean {
        return isAreaValid(node, areaMetric)
    }
}
 
export function isAreaValid(node: CodeMapNode, areaMetric: string): boolean {
    return node.deltas?.[areaMetric] < 0 || node.attributes?.[areaMetric] > 0
}