nodejs icon indicating copy to clipboard operation
nodejs copied to clipboard

Optimize auth.js: Replace Buffer.byteLength(body).toString() with simple body.length

Open studentIvan opened this issue 3 years ago • 0 comments

Summary

Replace Buffer.byteLength(body).toString() with simple body.length. It allows to use only Buffer.from polyfill, instead of the entire Buffer's polyfill (around 50kb)

Description

Check the sdk-auth umd file - we see the entire Buffer's polyfill here. For what?

Todo

  • Tests
    • [ ] Unit
    • [ ] Integration
    • [ ] Acceptance
  • [ ] Documentation
  • [ ] Type label for the PR

studentIvan avatar Jan 24 '21 10:01 studentIvan