EDumdum / iso-7064-js

Implementation of ISO 7064 used in validation of format like IBAN, LEI, ...
MIT License
8 stars 2 forks source link

IE11 problems noticed with small fix #1

Closed MikeMcNuke closed 5 years ago

MikeMcNuke commented 5 years ago

Hi,

thanks for your nice iso checker. I noticed that there is some ES6 writing in it that doesn't get handled by polyfills.

In your iso7064 model you omit key: value annotation, which is totally ok for ES6. If you are stuck with old browser support you can change the code to:

compute: function(rawValue) {

and

    computeWithoutCheck: function(rawValue) {
        return mod97(rawValue);
    }

In your stringifyInput function you set a default for valueName. Also, great for ES6. If you need it older just modify it like that:

function stringifyInput(rawValue, valueName) {
    if (valueName === undefined) {
      valueName = 'rawValue';
    }

And everything will be fine in the old browsers.

Hope this helps someone - only minor stuff. bye

EDumdum commented 5 years ago

Hi,

Thanks for the feedback and sorry for the late response. Looks like my mailbox blacklisted github :| I'll make a patch for that ASAP.