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 9 108x 12x 12x 12x 24x 24x        
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++) {
    Iif (parts1[i] > parts2[i]) return true;
    if (parts1[i] < parts2[i]) return false;
  }
  return false;
};