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

18 lines (16 loc) 374 B
import _ from 'lodash'; /** * @todo Make it work with ASCII content. * @param {table~row[]} rows * @param {Object} config * @returns {table~row[]} */ export default (rows, config) => { return rows.map((cells) => { return cells.map((content, index) => { return _.truncate(content, { length: config.columns[index].truncate }); }); }); };