"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.testDNI = void 0;
const testDNI = dni => {
  if (typeof dni !== 'string' || !/^[XYZ]?\d{5,8}[A-Z]$/.test(dni)) return false;
  const number = dni.toUpperCase().slice(0, -1).replace('X', 0).replace('Y', 1).replace('Z', 2) % 23;
  return 'TRWAGMYFPDXBNJZSQVHLCKET'[number] === dni.toUpperCase().slice(-1);
};
exports.testDNI = testDNI;
//# sourceMappingURL=testDNI.js.map