Code coverage report for lib/infer/should_skip_inference.js

Statements: 100% (7 / 7)      Branches: 100% (2 / 2)      Functions: 100% (3 / 3)      Lines: 100% (7 / 7)      Ignored: none     

All files » lib/infer/ » should_skip_inference.js
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20              28 451 1206 1978   143   1063       28  
/**
 * Decide whether a comment should go through the AST inference
 * stage based on whether it has an explicit `@name` tag.
 *
 * @param {Function} fn parser
 * @returns {boolean} true if the comment should skip inference
 */
function shouldSkipInference(fn) {
  return function (comment) {
    if (comment.tags.some(function (tag) {
      return tag.title === 'name';
    })) {
      return comment;
    }
    return fn(comment);
  };
}
 
module.exports = shouldSkipInference;