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

Commit aba179c

Browse files
committed
fix: replace node buffers with uint8arrays
Depends on: - [ ] multiformats/js-cid#117 BREAKING CHANGE: - `util.serialize` now returns a Uint8Array
1 parent 3b4b7e8 commit aba179c

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

package.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,12 @@
3838
},
3939
"homepage": "https://github.com/ipld/js-ipld-raw#readme",
4040
"dependencies": {
41-
"cids": "^0.8.1",
42-
"multicodec": "^1.0.1",
43-
"multihashing-async": "^0.8.1"
41+
"cids": "ipld/js-cid#fix/support-uint8arrays",
42+
"multicodec": "^2.0.0",
43+
"multihashing-async": "^2.0.0"
4444
},
4545
"devDependencies": {
46-
"aegir": "^22.0.0"
46+
"aegir": "^25.0.0",
47+
"uint8arrays": "^1.0.0"
4748
}
4849
}

test/index.spec.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@ const ipldRaw = require('../src/index')
66
const resolver = ipldRaw.resolver
77
const multihash = require('multihashing-async').multihash
88
const multicodec = require('multicodec')
9+
const uint8ArrayFromString = require('uint8arrays/from-string')
910

1011
describe('raw codec', () => {
11-
const testData = Buffer.from('test data')
12+
const testData = uint8ArrayFromString('test data')
1213
const testBlob = ipldRaw.util.serialize(testData)
1314

1415
it('multicodec is raw', () => {
@@ -39,7 +40,7 @@ describe('raw codec', () => {
3940
})
4041

4142
describe('raw util', () => {
42-
const rawData = Buffer.from('some raw data')
43+
const rawData = uint8ArrayFromString('some raw data')
4344

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

0 commit comments

Comments
 (0)