0.0.0 • Published 10 months ago

belgian-national-id-validator v0.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

Belgian National Id validator

Utility that allows you to validate the Belgian National Id

Usage

ES2016+

import { isValid } from "belgian-national-id-validator";

// Before 2000
isValid("75.12.05-137.14"); // true
isValid("75120513714"); // true

// After 2000
isValid("09.08.24-282.48"); // true
isValid("09082428248"); // true

// Invalid format
isValid("1111111"); // false

ES5

const belgianNationalIdValidator = require("belgian-national-id-validator");

// Before 2000
belgianNationalIdValidator.isValid("75.12.05-137.14"); // true
belgianNationalIdValidator.isValid("75120513714"); // true

// After 2000
isValid("09.08.24-282.48"); // true
belgianNationalIdValidator.isValid("09082428248"); // true

// Invalid format
belgianNationalIdValidator.isValid("1111111"); // false

Tests

To run the tests for this module:

npm test

Docs

License

MIT

0.0.0

10 months ago