fundsaccess / angular-iban

IBAN directives and pipes for Angular
MIT License
17 stars 7 forks source link

IBAN valid exact match (no spaces, hyphens) #20

Open mkczyk opened 1 year ago

mkczyk commented 1 year ago

IBAN with spaces is valid:

   DE02120300000000202051   

with hyphens also valid:

DE02120300000000202051---

with random spaces and hyphens also valid:

- - -DE02--1-20300- 00000--0202  051 - 

I think there should be exact match checking (no trim, clean etc.).

I guess this is related to possible formatting with ibanFormatter. But maybe only specified formatting should be allowed? Or add optional parameter to ValidatorService.validateIban which should valid with ignoring spaces and hyphens or without.

kimljj commented 1 year ago

Hi @mkczyk,

thanks for opening this issue and your suggestion for this library.

angular-iban is a wrapper of the library iban.js for Angular. If you check the source code of angular-iban, you will see the usage of it.

For me, this formatting is a nice feature. So far we didn't get any objections on it. But of couse, if we really want to change or improve it, we could open an issue at iban.js.

Sounds it good to you? 😉

Have a nice day! Jinjin

mkczyk commented 1 year ago

Thanks for clarification. You are right that library iban.js is responsible for that.

That formatting is nice, but validation with random characters not very much. I found corresponding issue in iban.js project: https://github.com/arhs/iban.js/issues/35. There was the same case but discussion stopped some years ago.

I found also that iban.js project is abandoned: https://github.com/arhs/iban.js/issues/88. Probably because of it, this issue isn't fixed. They recommend to switch to library ibantools (I tested this and above example with IBAN works as expected.).

Do you have any info about roadmap for angular-iban regarding abandoned iban.js? Switching to ibantools (but how it corresponds to other Angular libraries that use iban tools like ngx-iban)? Abandoning this project too?

kimljj commented 1 year ago

@mkczyk, thanks for the deep lookup. I will have a look at ibantools. If it's excellent, I will start with the switching. 👍