All files / src/utils semrel.ts

100% Statements 4/4
100% Branches 11/11
100% Functions 2/2
100% Lines 4/4

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 18              5x 1x     4x       3x    
export type Branch = {
  type?: string;
  main?: boolean;
  prerelease?: string | boolean;
};
 
export function isPrerelease({ type, main, prerelease }: Branch) {
  if (prerelease === false) {
    return false;
  }
 
  return type === 'prerelease' || (type === 'release' && !main) || typeof prerelease == 'string' || prerelease === true;
}
 
export function isLatestRelease({ type, main }: Branch) {
  return type === 'release' && main ? 'true' : 'false';
}