simple-websocket
Advanced tools
Comparing version 5.0.0 to 5.0.1
@@ -5,2 +5,3 @@ /* global WebSocket */ | ||
var Buffer = require('safe-buffer').Buffer | ||
var debug = require('debug')('simple-websocket') | ||
@@ -207,3 +208,3 @@ var inherits = require('inherits') | ||
var data = event.data | ||
if (data instanceof ArrayBuffer) data = new Buffer(data) | ||
if (data instanceof ArrayBuffer) data = Buffer.from(data) | ||
this.push(data) | ||
@@ -210,0 +211,0 @@ } |
{ | ||
"name": "simple-websocket", | ||
"description": "Simple, EventEmitter API for WebSockets (browser)", | ||
"version": "5.0.0", | ||
"version": "5.0.1", | ||
"author": { | ||
@@ -21,2 +21,3 @@ "name": "Feross Aboukhadijeh", | ||
"readable-stream": "^2.0.5", | ||
"safe-buffer": "^5.0.1", | ||
"ws": "^2.0.0" | ||
@@ -23,0 +24,0 @@ }, |
@@ -1,3 +0,12 @@ | ||
# simple-websocket [![travis](https://img.shields.io/travis/feross/simple-websocket/master.svg)](https://travis-ci.org/feross/simple-websocket) [![npm](https://img.shields.io/npm/v/simple-websocket.svg)](https://npmjs.org/package/simple-websocket) | ||
# simple-websocket [![travis][travis-image]][travis-url] [![npm][npm-image]][npm-url] [![downloads][downloads-image]][downloads-url] [![javascript style guide][standard-image]][standard-url] | ||
[travis-image]: https://img.shields.io/travis/feross/simple-websocket/master.svg | ||
[travis-url]: https://travis-ci.org/feross/simple-websocket | ||
[npm-image]: https://img.shields.io/npm/v/simple-websocket.svg | ||
[npm-url]: https://npmjs.org/package/simple-websocket | ||
[downloads-image]: https://img.shields.io/npm/dm/simple-websocket.svg | ||
[downloads-url]: https://npmjs.org/package/simple-websocket | ||
[standard-image]: https://img.shields.io/badge/code_style-standard-brightgreen.svg | ||
[standard-url]: https://standardjs.com | ||
#### Simple, EventEmitter API for WebSockets | ||
@@ -4,0 +13,0 @@ |
@@ -68,6 +68,6 @@ var Socket = require('../') | ||
t.pass('connect emitted') | ||
socket.send(new Buffer([1, 2, 3])) | ||
socket.send(Buffer.from([1, 2, 3])) | ||
socket.on('data', function (data) { | ||
t.ok(Buffer.isBuffer(data), 'data is Buffer') | ||
t.deepEqual(data, new Buffer([1, 2, 3]), 'got correct data') | ||
t.deepEqual(data, Buffer.from([1, 2, 3]), 'got correct data') | ||
@@ -92,3 +92,3 @@ socket.destroy(function () { | ||
t.ok(Buffer.isBuffer(data), 'data is Buffer') | ||
t.deepEqual(data, new Buffer([1, 2, 3]), 'got correct data') | ||
t.deepEqual(data, Buffer.from([1, 2, 3]), 'got correct data') | ||
@@ -111,3 +111,3 @@ socket.destroy(function () { | ||
t.ok(Buffer.isBuffer(data), 'data is Buffer') | ||
t.deepEqual(data, new Buffer([1, 2, 3]), 'got correct data') | ||
t.deepEqual(data, Buffer.from([1, 2, 3]), 'got correct data') | ||
@@ -114,0 +114,0 @@ socket.destroy(function () { |
@@ -41,6 +41,6 @@ /* global WebSocket */ | ||
t.pass('connect emitted') | ||
socket.send(new Buffer([1, 2, 3])) | ||
socket.send(Buffer.from([1, 2, 3])) | ||
socket.on('data', function (data) { | ||
t.ok(Buffer.isBuffer(data), 'data is Buffer') | ||
t.deepEqual(data, new Buffer([1, 2, 3]), 'got correct data') | ||
t.deepEqual(data, Buffer.from([1, 2, 3]), 'got correct data') | ||
@@ -68,3 +68,3 @@ socket.destroy(function () { | ||
t.ok(Buffer.isBuffer(data), 'data is Buffer') | ||
t.deepEqual(data, new Buffer([1, 2, 3]), 'got correct data') | ||
t.deepEqual(data, Buffer.from([1, 2, 3]), 'got correct data') | ||
@@ -90,3 +90,3 @@ socket.destroy(function () { | ||
t.ok(Buffer.isBuffer(data), 'data is Buffer') | ||
t.deepEqual(data, new Buffer([1, 2, 3]), 'got correct data') | ||
t.deepEqual(data, Buffer.from([1, 2, 3]), 'got correct data') | ||
@@ -93,0 +93,0 @@ socket.destroy(function () { |
@@ -36,6 +36,6 @@ var Socket = require('../') | ||
t.pass('connect emitted') | ||
socket.send(new Buffer([1, 2, 3])) | ||
socket.send(Buffer.from([1, 2, 3])) | ||
socket.on('data', function (data) { | ||
t.ok(Buffer.isBuffer(data), 'data is Buffer') | ||
t.deepEqual(data, new Buffer([1, 2, 3]), 'got correct data') | ||
t.deepEqual(data, Buffer.from([1, 2, 3]), 'got correct data') | ||
@@ -63,3 +63,3 @@ socket.destroy(function () { | ||
t.ok(Buffer.isBuffer(data), 'data is Buffer') | ||
t.deepEqual(data, new Buffer([1, 2, 3]), 'got correct data') | ||
t.deepEqual(data, Buffer.from([1, 2, 3]), 'got correct data') | ||
@@ -85,3 +85,3 @@ socket.destroy(function () { | ||
t.ok(Buffer.isBuffer(data), 'data is Buffer') | ||
t.deepEqual(data, new Buffer([1, 2, 3]), 'got correct data') | ||
t.deepEqual(data, Buffer.from([1, 2, 3]), 'got correct data') | ||
@@ -88,0 +88,0 @@ socket.destroy(function () { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
89446
832
153
6
+ Addedsafe-buffer@^5.0.1