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 d34850b commit 6b293cd
Showing 1 changed file with 1 addition and 4 deletions.
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 6b293cd

Please sign in to comment.