UNPKG

luhn-generator

Version:

A generator of numbers that passes the validation of Luhn algorithm or Luhn formula, also known as the 'modulus 10' or 'mod 10' algorithm

30 lines (24 loc) 547 B
import visibleVirtual from '../../commons/text/visible-virtual'; function svgNonEmptyTitleEvaluate(node, options, virtualNode) { try { const titleNode = virtualNode.children.find(({ props }) => { return props.nodeName === 'title'; }); if (!titleNode) { this.data({ messageKey: 'noTitle' }); return false; } if (visibleVirtual(titleNode) === '') { this.data({ messageKey: 'emptyTitle' }); return false; } return true; } catch (e) { return undefined; } } export default svgNonEmptyTitleEvaluate;