version-check.js 268 B

123456789
  1. /**
  2. * Check if QR Code version is valid
  3. *
  4. * @param {Number} version QR Code version
  5. * @return {Boolean} true if valid version, false otherwise
  6. */
  7. exports.isValid = function isValid (version) {
  8. return !isNaN(version) && version >= 1 && version <= 40
  9. }