arg.js icon indicating copy to clipboard operation
arg.js copied to clipboard

CBU functions should throw an exception when the number is not valid.

Open hnicodemo opened this issue 8 years ago • 2 comments

I think getAssociatedBank, getBankCode y getBranch should start with:

if (!isValid(cbu)) throw new Error('CBU is not valid);

hnicodemo avatar Apr 06 '17 12:04 hnicodemo

@hnicodemo please create a PR and i'll have a look. Thanks!

miparnisari avatar Aug 15 '17 06:08 miparnisari

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.

gastonelhordoy avatar Nov 12 '18 15:11 gastonelhordoy