Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use const and let #10

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

use const and let #10

wants to merge 2 commits into from

Conversation

jimmywarting
Copy link

@jimmywarting jimmywarting commented May 23, 2021

I was gona try to convert this to ESM but all the exports[xxxx]encode.bytes = x made it a bit weird.

So i just converted most of the code to use const and let, some default arguments here and there and some arrow fn and also reduced the number of exports by doing something like:

- exports.esds = {}
- exports.esds.encode = fn
- exports.esds.decode = fn
- exports.esds.encodingLength = fn

+ exports.esds = {
+  encode(...args) { ...}
+  decode(...args) { ...}
+  encodingLength(...args) { ...}
+ }

The conversion was mostly done with lebab. Didn't want to do too many changes - afraid to do any breaking stuff when there are no tests...
but the conversion to export an object instead makes it easier to iterate over to try and modernize it a bit furtherer

(have also updated all the dependencies)

@jimmywarting
Copy link
Author

ping @jhiesey

@jhiesey
Copy link
Owner

jhiesey commented Jan 15, 2022

Sorry, I haven't been maintaining this well recently. I'll take a look soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants