UNPKG

french-ssn

Version:

🇫🇷 A parser / validator for French Social Security Number

15 lines • 450 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const getLength = (string) => { if (typeof string === "number") { string = string.toString(); } if (typeof string === "string") { return string.length; } throw new Error("Cannot pad " + string); }; exports.default = (string, length) => { return `${"0".repeat(length - getLength(string))}${string}`; }; //# sourceMappingURL=pad.js.map