-
Notifications
You must be signed in to change notification settings - Fork 24
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
Modified package to now use class based approach #10
Conversation
Hi @gavinhenderson I'll review this asap. |
index.js
Outdated
@@ -16,7 +25,7 @@ const queue = []; | |||
* @param {Function} algorithm.identifiers A function that returns the list of | |||
* identifiers that this password hashing algorithm is able to generate / verify. | |||
*/ | |||
function install(name, algorithm) { | |||
Upash.prototype.install = function(name, algorithm) { |
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.
This should be private, we want the instance to be immutable
index.js
Outdated
|
||
/** | ||
* Uninstalls a password hashing function previously installed. | ||
* @public | ||
* @param {string} name The name of the algorithm to uninstall or 'last' to | ||
* uninstall the last one installed. | ||
*/ | ||
function uninstall(name) { | ||
Upash.prototype.uninstall = function(name) { |
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.
We should remove this
@@ -102,32 +111,32 @@ function list() { | |||
* @param {string|undefined} name The name of the algorithm to use. | |||
* @return {Object} The password hashing function object. | |||
*/ | |||
function use(name) { | |||
Upash.prototype.use = function(name) { |
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.
This should set the default for the current instance
@simonepri Thats those three changes made now. If you think these changes are okay let me know and I'll add more tests for the new API and I'll improve the way setting default works. |
Hey @simonepri , just wondering if there was any more changes you wanted me to make 👍 |
Hey @gavinhenderson sorry for the long delay, It looks cool. Thank you for contributing! |
Hey @simonepri, I hope youre well! I noticed there hasn't been any changes on master for 4 months. Is there plans to mainain this project or should I close my pull request? |
@gavinhenderson Sorry for the long delay. |
Updates on this? I would like to contribute changes that would benefit from a class based system. |
@indo-dev-0 no updates from me |
Sorry for the 1-year long delay. (I had an intense year) |
Here are the changes proposed in #9. They are by no means complete just wanted to get some opinions on the changes made so far before I put more time into tidying the code and adding more tests.