-
Notifications
You must be signed in to change notification settings - Fork 25
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
feat: prevent side effect on create
#9
Conversation
Kind ping @vasco-santos |
Hello @eordano ! Sorry, for the late answer. When creating a PR, please ask for a review directly as I will receive an email and it will be faster 🙂 |
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.
Thanks for your PR!
Left two comments here. Besides fixing them, please add a test for this new function.
src/index.js
Outdated
} | ||
|
||
/** | ||
* Same as create(), but prevent generating a Date(). |
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.
Same as create(), but instead of generating a new Date, it receives the intended expiration time
src/index.js
Outdated
* @param {Object} privateKey private key for signing the record. | ||
* @param {string} value value to be stored in the record. | ||
* @param {number} seq number representing the current version of the record. | ||
* @param {string} expiration lifetime of the record (in nanoseconds). |
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.
Update the description of the expiration to something expiration time of the record (in nanoseconds)
Updated based on comments (thanks @vasco-santos!) |
This allows two `createWithExpiration` to have the same return value without mocking the global `require('nano-date')`
Kind ping @vasco-santos |
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.
Thanks @eordano
@eordano just released |
Thanks! |
This allows two
createWithExpiration
to have the same return value without mocking the globalrequire('nano-date')