UNPKG

french-ssn

Version:

🇫🇷 A parser / validator for French Social Security Number

15 lines • 745 B
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); const getControlKey_1 = __importDefault(require("./getControlKey")); const pad_1 = __importDefault(require("./pad")); const lengths = [1, 2, 2, 5, 3]; exports.default = ({ gender = "2", year = "89", month = "04", place = "78650", rank = "163", controlKey, }) => { const partial = [gender, year, month, place, rank] .map((value, index) => (0, pad_1.default)(value, lengths[index])) .join(""); return `${partial}${controlKey || (0, getControlKey_1.default)(partial)}`; }; //# sourceMappingURL=makeSSN.js.map