arg.js
arg.js copied to clipboard
CBU functions should throw an exception when the number is not valid.
I think getAssociatedBank, getBankCode y getBranch should start with:
if (!isValid(cbu)) throw new Error('CBU is not valid);
@hnicodemo please create a PR and i'll have a look. Thanks!
As a validation library I would suggest not to throw errors. IMHO doing so is a highly opinionated assumption.
Developers using this lib should decide what to do upon an invalid value, either throwing an error, providing a more detailed explanation of the issue in the context of the app or whatever makes sense to them.
Excellent work BTW, I would probably contribute adding new banks like Wilobank.