提交 c9752879 编写于 作者: Huan (李卓桓)'s avatar Huan (李卓桓)

fix(types): new ws typing fix

上级 79635598
{
"name": "wechaty",
"version": "0.8.93",
"version": "0.8.94",
"lockfileVersion": 1,
"dependencies": {
"@ava/babel-preset-stage-4": {
......@@ -94,9 +94,9 @@
"dev": true
},
"@types/ws": {
"version": "0.0.41",
"resolved": "https://registry.npmjs.org/@types/ws/-/ws-0.0.41.tgz",
"integrity": "sha1-iKfgzRYFvW6ncxEJVGcTlMaQ2xo=",
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/@types/ws/-/ws-3.0.0.tgz",
"integrity": "sha512-izHR5cQvRE6nG828CkNd3pOCIjwZ/poOhxeeLyBWyRoXBDZ2qSA7iEHwp7XFnq7seJk9APpm8iJBau4fAhDY0Q==",
"dev": true
},
"accepts": {
......
......@@ -144,11 +144,15 @@ export class Io {
})
ws.on('message', (data, flags) => {
ws.on('message', data => {
log.silly('Io', 'initWebSocket() ws.on(message): %s', data)
// flags.binary will be set if a binary data is received.
// flags.masked will be set if the data was masked.
if (typeof data !== 'string') {
throw new Error('data should be string...')
}
const ioEvent: IoEvent = {
name: 'raw',
payload: data,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册