All files / sdk/utils other.ts

81.81% Statements 9/11
50% Branches 1/2
100% Functions 1/1
85.71% Lines 6/7

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 96x 7x 7x 7x 21x 14x      
export const isNewerVersion  = (v1: string, v2: string): boolean => {
    const parts1 = v1.split('.').map(Number);
    const parts2 = v2.split('.').map(Number);
    for (let i = 0; i < 3; i++) {
        if (parts1[i] > parts2[i]) return true;
        Iif (parts1[i] < parts2[i]) return false;
    }
    return false;
}