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

Commit

Permalink
feat: support string data in pubsub.publish
Browse files Browse the repository at this point in the history
License: MIT
Signed-off-by: Alan Shaw <alan.shaw@protocol.ai>
  • Loading branch information
alanshaw committed Aug 28, 2019
1 parent 05f9e70 commit 743cacd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
"cross-env": "^5.2.0",
"dirty-chai": "^2.0.1",
"go-ipfs-dep": "~0.4.21",
"interface-ipfs-core": "^0.110.0",
"interface-ipfs-core": "^0.111.0",
"ipfsd-ctl": "~0.43.0",
"nock": "^10.0.2",
"stream-equal": "^1.1.1"
Expand Down
5 changes: 1 addition & 4 deletions src/pubsub/publish.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@ const configure = require('../lib/configure')
module.exports = configure(({ ky }) => {
return async (topic, data, options) => {
options = options || {}

if (!Buffer.isBuffer(data)) {
throw new Error('data must be a Buffer')
}
data = Buffer.from(data)

const searchParams = new URLSearchParams(options.searchParams)
searchParams.set('arg', topic)
Expand Down

0 comments on commit 743cacd

Please sign in to comment.