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

Commit

Permalink
fix: replace node buffers with uint8arrays
Browse files Browse the repository at this point in the history
Depends on:

- [ ] multiformats/js-cid#117

BREAKING CHANGE:

- `util.serialize` now returns a Uint8Array
  • Loading branch information
achingbrain committed Aug 3, 2020
1 parent 3b4b7e8 commit aba179c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,12 @@
},
"homepage": "https://github.com/ipld/js-ipld-raw#readme",
"dependencies": {
"cids": "^0.8.1",
"multicodec": "^1.0.1",
"multihashing-async": "^0.8.1"
"cids": "ipld/js-cid#fix/support-uint8arrays",
"multicodec": "^2.0.0",
"multihashing-async": "^2.0.0"
},
"devDependencies": {
"aegir": "^22.0.0"
"aegir": "^25.0.0",
"uint8arrays": "^1.0.0"
}
}
5 changes: 3 additions & 2 deletions test/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ const ipldRaw = require('../src/index')
const resolver = ipldRaw.resolver
const multihash = require('multihashing-async').multihash
const multicodec = require('multicodec')
const uint8ArrayFromString = require('uint8arrays/from-string')

describe('raw codec', () => {
const testData = Buffer.from('test data')
const testData = uint8ArrayFromString('test data')
const testBlob = ipldRaw.util.serialize(testData)

it('multicodec is raw', () => {
Expand Down Expand Up @@ -39,7 +40,7 @@ describe('raw codec', () => {
})

describe('raw util', () => {
const rawData = Buffer.from('some raw data')
const rawData = uint8ArrayFromString('some raw data')

it('serialize is noop', () => {
const result = ipldRaw.util.serialize(rawData)
Expand Down

0 comments on commit aba179c

Please sign in to comment.