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

Commit 6b293cd

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 d34850b commit 6b293cd

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/pubsub/publish.js

+1-4
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)