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

changes put to return key and value passed #46

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

utanapishtim
Copy link
Contributor

This change allows put to return the key and value passed to it upon a successful write.

test/all.js Outdated
for (const test of tests) {
const feed = new Hypercore(require('random-access-memory'))
const db = new Hyperbee(feed, test.opts)
await db.ready()
Copy link
Contributor

Choose a reason for hiding this comment

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

not needed

test/all.js Outdated
const Hypercore = require('hypercore')
for (const test of tests) {
const feed = new Hypercore(require('random-access-memory'))
const db = new Hyperbee(feed, test.opts)
Copy link
Contributor

Choose a reason for hiding this comment

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

use the create helper

test/all.js Outdated
await db.ready()
const result = await db.put(test.key, test.value)
test.t(result, test.key, test.value)
}
Copy link
Contributor

Choose a reason for hiding this comment

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

actually this loop doesn't help much with clarity. just duplicate the creation between three independent tests instead and use the create helper :)

@gmaclennan
Copy link

Came here looking for this functionality 👍

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.

3 participants