All files form_validator.js

100% Statements 5/5
100% Branches 4/4
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 17 18 19 20    10x 10x       7x       6x     2x          
function isValidCommaDelimitedList(value) {
  // allow letters, commas, and spaces
  const commaDelimitedListRegEx = /^[A-Za-z,\s]+$/;
  return commaDelimitedListRegEx.test(value);
}
 
function isValidTagmode(value) {
  return value === 'all' || value === 'any';
}
 
function hasValidFlickrAPIParams(tags, tagmode) {
  return isValidCommaDelimitedList(tags) && isValidTagmode(tagmode);
}
 
module.exports = {
  isValidCommaDelimitedList,
  isValidTagmode,
  hasValidFlickrAPIParams
};