dankogai / js-base64

Base64 implementation for JavaScript
BSD 3-Clause "New" or "Revised" License
4.27k stars 1.33k forks source link

minor fix in tsconfig.json #147

Closed liansnail closed 3 years ago

liansnail commented 3 years ago

Minor fix in tsconfig.json file because it didn't properly compiles into ES2015.

Test passed checked.

dankogai commented 3 years ago

Thank you! Since the resulting .{mjs,js} remains the same I am not upgrading the version.

liansnail commented 3 years ago

My bad. I didn't push with typescript compiling because I thought CI/CD will do it.

Since I upload typescript compiler options, it should be re-compiled. For example

const b64tab = ((a) => { let tab = {}; a.forEach((c, i) => tab[c] = i); return tab; })(b64chs);

Anonymous function b64tab will be changed to ES5 if you compile again.

dankogai commented 3 years ago

Take it easy. b64tab is not an anonymous function. it is an object which maps characters to integers (Number).

const b64tab // object
  =   ( // anonymous function
    (a) => { let tab = {}; a.forEach((c, i) => tab[c] = i); return tab; }
  )(
      b64chs // argument (string)
  );

I also made sure the resulting .{mjs,js} remains the same by make clean (deletes .mjs and js) and make test.

liansnail commented 3 years ago

Sorry. I meant 'arrow function'.