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

13 lines (10 loc) 297 B
'use strict'; var path = require('path'); var binaryExtensions = require('binary-extensions'); var exts = Object.create(null); binaryExtensions.forEach(function (el) { exts[el] = true; }); module.exports = function (filepath) { return path.extname(filepath).slice(1).toLowerCase() in exts; };