Skip to content
This repository was archived by the owner on Mar 10, 2020. It is now read-only.

Commit 743cacd

Browse files
author
Alan Shaw
committed
feat: support string data in pubsub.publish
License: MIT Signed-off-by: Alan Shaw <alan.shaw@protocol.ai>
1 parent 05f9e70 commit 743cacd

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@
9292
"cross-env": "^5.2.0",
9393
"dirty-chai": "^2.0.1",
9494
"go-ipfs-dep": "~0.4.21",
95-
"interface-ipfs-core": "^0.110.0",
95+
"interface-ipfs-core": "^0.111.0",
9696
"ipfsd-ctl": "~0.43.0",
9797
"nock": "^10.0.2",
9898
"stream-equal": "^1.1.1"

src/pubsub/publish.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,7 @@ const configure = require('../lib/configure')
66
module.exports = configure(({ ky }) => {
77
return async (topic, data, options) => {
88
options = options || {}
9-
10-
if (!Buffer.isBuffer(data)) {
11-
throw new Error('data must be a Buffer')
12-
}
9+
data = Buffer.from(data)
1310

1411
const searchParams = new URLSearchParams(options.searchParams)
1512
searchParams.set('arg', topic)

0 commit comments

Comments
 (0)