Skip to content
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

Merged
merged 1 commit into from
Sep 24, 2018
Merged

feat: prevent side effect on create #9

merged 1 commit into from
Sep 24, 2018

Conversation

eordano
Copy link
Contributor

@eordano eordano commented Sep 11, 2018

This allows two createWithExpiration to have the same return value without mocking the global require('nano-date')

@eordano
Copy link
Contributor Author

eordano commented Sep 19, 2018

Kind ping @vasco-santos

@vasco-santos
Copy link
Member

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 🙂

Copy link
Member

@vasco-santos vasco-santos left a 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().
Copy link
Member

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).
Copy link
Member

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)

@eordano
Copy link
Contributor Author

eordano commented Sep 20, 2018

Updated based on comments (thanks @vasco-santos!)

This allows two `createWithExpiration` to have the same return value without mocking the global `require('nano-date')`
@eordano
Copy link
Contributor Author

eordano commented Sep 23, 2018

Kind ping @vasco-santos

Copy link
Member

@vasco-santos vasco-santos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @eordano

@vasco-santos vasco-santos merged commit 576bc1a into ipfs:master Sep 24, 2018
@vasco-santos
Copy link
Member

vasco-santos commented Sep 24, 2018

@eordano just released ipns@0.2.1 🚀

@eordano
Copy link
Contributor Author

eordano commented Sep 24, 2018

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants