-
Notifications
You must be signed in to change notification settings - Fork 71
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
Refactor to use es6 features #84
Conversation
Sorry, opened it prematurely. As per your comment on #77, I've used ES6 features (specifically: classes, Object.assign, let/const). This PR also includes a minor refactor of code with the creation of a I apologize for the one big commit. I'll change it if it's an annoyance |
Thanks for the PR! Will look at it soon. |
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.
That is a nice PR! Thanks a lot for it.
I found a few things which could be improved and commented on them. It's been a while since you've made this PR (sorry!) so I'd totally understand if you don't wanna fix them and will do that myself.
Otherwise there would be a few more syntax improvements but those aren't really necessary (a few cases where object property shorthand could be used).
lib/connect-session-sequelize.js
Outdated
set (sid, data, fn) { | ||
debug('INSERT "%s"', sid) | ||
const stringData = JSON.stringify(data) | ||
let expires = this.expiration(data) |
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.
I believe this can be a const
lib/connect-session-sequelize.js
Outdated
|
||
var expires | ||
let expires = this.expiration(data) |
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.
can be a const
too, I think
lib/connect-session-sequelize.js
Outdated
expiration (data) { | ||
if (data.cookie && data.cookie.expires) { | ||
return data.cookie.expires | ||
} else { |
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.
else is not strictly needed as you return anyway
Also refactoring the expiration to an own function: 👍 nice. |
I'm sorry I never finished this! Give me some time and I'll get to it. Thanks for your patience @mweibel! |
I've made the changes as proposed. Feel free to merge it in if you think it's good, and let me know if you'd like me to make any other amends. Thank you for your patience with me @mweibel! |
👍 thanks! Will release soon. |
No description provided.