All files / lib/rules execute-rule-default.js

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

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  13x 37x 37x   13x 12x       6x  
function executeRuleDefault(values) {
  const firstMatch = values.find((value) => {
    const keys = Object.keys(value);
    return keys.length === 1 && keys[0] === 'value';
  });
  if (firstMatch) {
    return firstMatch.value;
  }
}
 
module.exports = executeRuleDefault;