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

16 lines (14 loc) 356 B
/** * @typedef {Object} drawRow~border * @property {string} bodyLeft * @property {string} bodyRight * @property {string} bodyJoin */ /** * @param {number[]} columns * @param {drawRow~border} border * @returns {string} */ export default (columns, border) => { return border.bodyLeft + columns.join(border.bodyJoin) + border.bodyRight + '\n'; };