koblas / stdnum-js

A JavaScript library to provide functions to handle, parse and validate standard numbers.
MIT License
39 stars 26 forks source link

feat(be): add bis and insz #23

Closed mikeryancodes closed 2 years ago

mikeryancodes commented 2 years ago

This work adds Belgium BIS and INSZ.

The BIS appears to be quite similar to the NN, except that the DOB month portion of the identifier is incremented by either 20 or 40.

I tried and could not find what 'BIS' stands for online.

This refactors the NN code so it can use an optional function for getting the DOB from the original number, and then uses that to implement BIS.

It appears that an INSZ number is either a BIS or NN, I wrote this validator in terms of the other two taking an 'invalid checksum' error over an 'invalid format' error if we get different errors as noted.

commit-lint[bot] commented 2 years ago

Contributors

mikeryancodes

Commit-Lint commands
You can trigger Commit-Lint actions by commenting on this PR: - `@Commit-Lint merge patch` will merge dependabot PR on "patch" versions (X.X.Y - Y change) - `@Commit-Lint merge minor` will merge dependabot PR on "minor" versions (X.Y.Y - Y change) - `@Commit-Lint merge major` will merge dependabot PR on "major" versions (Y.Y.Y - Y change) - `@Commit-Lint merge disable` will desactivate merge dependabot PR - `@Commit-Lint review` will approve dependabot PR - `@Commit-Lint stop review` will stop approve dependabot PR