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

15 lines (11 loc) 425 B
import { sanitize } from '../../commons/text'; function attrNonSpaceContentEvaluate(node, options = {}, vNode) { if (!options.attribute || typeof options.attribute !== 'string') { throw new TypeError( 'attr-non-space-content requires options.attribute to be a string' ); } const attribute = vNode.attr(options.attribute) || ''; return !!sanitize(attribute.trim()); } export default attrNonSpaceContentEvaluate;