-
Notifications
You must be signed in to change notification settings - Fork 7
Revert #2 and #4, update encode/tests #5
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
Conversation
|
@dcousens I change conditions in |
| check: check, | ||
| decode: decode, | ||
| encode: encode | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Personally I prefer the module.exports at the end approach... easier to visualize.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dcousens then, let's back to this code. What do you think about export right after require?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@fanatid can't stand it.
I follow these three rules which lead to the result I typically have:
- No use before declaration
- No repeated declarations
- Prefer named functions
- Group hackish/lame/ugly code for easy removal one day
Moving the exports to the top breaks my first rule.
The current implementation breaks my second rule, and removing the function name makes it an anonymous function (ew).
The previous implementation met all these rules.
Ideally, ES Next's export style syntax would be available... until then, I use the module.exports = {} at EOF.
Thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dcousens thanks for published your rules, it's really helpful.
I'm ok with them, do you need PR for module.export or you do this yourself?
Can you publish new version after this?
|
Thanks @fanatid |
index: revert #5 encode changes
No description provided.