All files / src/nodes BinaryOperation.js

100% Statements 9/9
100% Branches 2/2
100% Functions 1/1
100% Lines 7/7

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  55x   55x   6105x 6105x 18190x 6105x         55x  
/* eslint-disable consistent-return */
const printers = require('../binary-operator-printers');
 
const BinaryOperation = {
  print: ({ node, path, print, options }) => {
    const printerKeys = Object.keys(printers);
    for (let i = 0, len = printerKeys.length; i < len; i += 1) {
      if (printers[printerKeys[i]].match(node.operator))
        return printers[printerKeys[i]].print(node, path, print, options);
    }
  }
};
 
module.exports = BinaryOperation;