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

17 lines (14 loc) 394 B
import { closest } from '../../core/utils'; import { accessibleTextVirtual } from '../../commons/text'; function implicitEvaluate(node, options, virtualNode) { try { const label = closest(virtualNode, 'label'); if (label) { return !!accessibleTextVirtual(label, { inControlContext: true }); } return false; } catch (e) { return undefined; } } export default implicitEvaluate;