Skip to content
This repository has been archived by the owner on Oct 1, 2021. It is now read-only.

fix: replace node buffers with uint8arrays #25

Merged
merged 2 commits into from
Aug 5, 2020

Conversation

achingbrain
Copy link
Member

@achingbrain achingbrain commented Jul 30, 2020

BREAKING CHANGES:

- node `Buffer`s have been replaced with `Uint8Array`s
await store.put(VERSION_KEY, Buffer.from(loadFixture('test/fixtures/test-repo/version')))
await store.put(CONFIG_KEY, Buffer.from(loadFixture('test/fixtures/test-repo/config')))
await store.put(VERSION_KEY, loadFixture('test/fixtures/test-repo/version'))
await store.put(CONFIG_KEY, loadFixture('test/fixtures/test-repo/config'))
Copy link

Choose a reason for hiding this comment

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

🤷‍♂️ I'm not sure I get why Buffer.from was used in first place because loadFixture returns buffer as far as I can tell. It's probably a good idea to turns them into Uint8Arrays to ensure that put does in fact works with Uint8Array as opposed to Buffer.

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm not sure either TBH.

Converting them to Unint8Arrays to ensure it works seems unnecessary as we're not testing the store implementation here.

@achingbrain achingbrain merged commit 1e7592d into master Aug 5, 2020
@achingbrain achingbrain deleted the fix/replace-node-buffers-with-uint8arrays branch August 5, 2020 06:48
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants