-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Javascript tweaks #3211
Javascript tweaks #3211
Conversation
THanks! I'll let @atoppi comment on this, since most of the JS stuff I'm clueless about. |
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.
Hello @i8-pi and thanks for the effort!
Since we are migrating core objects to maps, I'd like to switch Janus.sessions too.
Could you please add it to the PR?
Also please address the notes I've left.
I will update Janus.sessions to use Maps as well. This will be externally visible though, unlike the other two changes, so maybe we should mentions that in the changelog |
Good point. Pinging @lminiero to help taking a decision, since he is the main maintainer/user/hacker of the library. Side note: in case we decide to proceed with sessions Map, we should also update the types. |
I've made the requested changes. The Janus.sessions change is there if you want it. The typescript files don't mention Janus.sessions and no changes should be required for that |
Thanks, merging! |
A few improvements in the Javascript that should not impact functionality
The first commit
npm run lint
from the command line, which checks both js and html filesThe second commit swaps plain objects with JS Maps where the objects are used as arbitrary key-value stores. Plain objects come with some predefined keys
which can be a problem if the keys come from user input, while Maps are specifically designed to be arbitrary key-value stores
The code changes are mostly mechanical