caption-faked-evaluate.js 416 B

12345678910111213141516
  1. import { toGrid } from '../../commons/table';
  2. function captionFakedEvaluate(node) {
  3. var table = toGrid(node);
  4. var firstRow = table[0];
  5. if (table.length <= 1 || firstRow.length <= 1 || node.rows.length <= 1) {
  6. return true;
  7. }
  8. return firstRow.reduce((out, curr, i) => {
  9. return out || (curr !== firstRow[i + 1] && firstRow[i + 1] !== undefined);
  10. }, false);
  11. }
  12. export default captionFakedEvaluate;