All files / src/utils ValidationUtils.js

100% Statements 5/5
100% Branches 2/2
100% Functions 3/3
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 176x 6x     50x       50x       183x        
const VALID_STYLES = ["american", "european"];
const VALID_TYPES = ["call", "put"];
 
function isValidStyle(style) {
  return VALID_STYLES.includes(style);
}
 
function isValidType(type) {
  return VALID_TYPES.includes(type);
}
 
function isNumberGreaterThanZero(value) {
  return Number.isFinite(value) && value > 0;
}
 
export { isValidStyle, isValidType, isNumberGreaterThanZero };