Skip to content

Commit 51d7529

Browse files
[chore] Release 3.0.0
1 parent 7a72404 commit 51d7529

File tree

3 files changed

+43
-35
lines changed

3 files changed

+43
-35
lines changed

History.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
11

2+
3.0.0 / 2017-04-06
3+
===================
4+
5+
* [chore] Bump dependencies (#560)
6+
* [fix] Default `rejectUnauthorized` to `true` (#558)
7+
* [chore] Drop support for old nodejs versions (0.10 & 0.12) (#557)
8+
29
2.1.1 / 2017-03-22
310
===================
411

engine.io.js

Lines changed: 34 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ return /******/ (function(modules) { // webpackBootstrap
172172
this.cert = opts.cert || null;
173173
this.ca = opts.ca || null;
174174
this.ciphers = opts.ciphers || null;
175-
this.rejectUnauthorized = opts.rejectUnauthorized === undefined ? null : opts.rejectUnauthorized;
175+
this.rejectUnauthorized = opts.rejectUnauthorized === undefined ? true : opts.rejectUnauthorized;
176176
this.forceNode = !!opts.forceNode;
177177

178178
// other options for Node.js client
@@ -2445,7 +2445,8 @@ return /******/ (function(modules) { // webpackBootstrap
24452445
/* 11 */
24462446
/***/ function(module, exports, __webpack_require__) {
24472447

2448-
/* WEBPACK VAR INJECTION */(function(global) {
2448+
/* WEBPACK VAR INJECTION */(function(global) {/* global Blob File */
2449+
24492450
/*
24502451
* Module requirements.
24512452
*/
@@ -2461,48 +2462,46 @@ return /******/ (function(modules) { // webpackBootstrap
24612462
/**
24622463
* Checks for binary data.
24632464
*
2464-
* Right now only Buffer and ArrayBuffer are supported..
2465+
* Supports Buffer, ArrayBuffer, Blob and File.
24652466
*
24662467
* @param {Object} anything
24672468
* @api public
24682469
*/
24692470

2470-
function hasBinary(data) {
2471-
2472-
function _hasBinary(obj) {
2473-
if (!obj) return false;
2471+
function hasBinary (obj) {
2472+
if (!obj || typeof obj !== 'object') {
2473+
return false;
2474+
}
24742475

2475-
if ( (global.Buffer && global.Buffer.isBuffer && global.Buffer.isBuffer(obj)) ||
2476-
(global.ArrayBuffer && obj instanceof ArrayBuffer) ||
2477-
(global.Blob && obj instanceof Blob) ||
2478-
(global.File && obj instanceof File)
2479-
) {
2480-
return true;
2476+
if (isArray(obj)) {
2477+
for (var i = 0, l = obj.length; i < l; i++) {
2478+
if (hasBinary(obj[i])) {
2479+
return true;
2480+
}
24812481
}
2482+
return false;
2483+
}
24822484

2483-
if (isArray(obj)) {
2484-
for (var i = 0; i < obj.length; i++) {
2485-
if (_hasBinary(obj[i])) {
2486-
return true;
2487-
}
2488-
}
2489-
} else if (obj && 'object' == typeof obj) {
2490-
// see: https://github.com/Automattic/has-binary/pull/4
2491-
if (obj.toJSON && 'function' == typeof obj.toJSON) {
2492-
obj = obj.toJSON();
2493-
}
2485+
if ((typeof global.Buffer === 'function' && global.Buffer.isBuffer && global.Buffer.isBuffer(obj)) ||
2486+
(typeof global.ArrayBuffer === 'function' && obj instanceof ArrayBuffer) ||
2487+
(typeof global.Blob === 'function' && obj instanceof Blob) ||
2488+
(typeof global.File === 'function' && obj instanceof File)
2489+
) {
2490+
return true;
2491+
}
24942492

2495-
for (var key in obj) {
2496-
if (Object.prototype.hasOwnProperty.call(obj, key) && _hasBinary(obj[key])) {
2497-
return true;
2498-
}
2499-
}
2500-
}
2493+
// see: https://github.com/Automattic/has-binary/pull/4
2494+
if (obj.toJSON && typeof obj.toJSON === 'function' && arguments.length === 1) {
2495+
return hasBinary(obj.toJSON(), true);
2496+
}
25012497

2502-
return false;
2498+
for (var key in obj) {
2499+
if (Object.prototype.hasOwnProperty.call(obj, key) && hasBinary(obj[key])) {
2500+
return true;
2501+
}
25032502
}
25042503

2505-
return _hasBinary(data);
2504+
return false;
25062505
}
25072506

25082507
/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))
@@ -2511,8 +2510,10 @@ return /******/ (function(modules) { // webpackBootstrap
25112510
/* 12 */
25122511
/***/ function(module, exports) {
25132512

2513+
var toString = {}.toString;
2514+
25142515
module.exports = Array.isArray || function (arr) {
2515-
return Object.prototype.toString.call(arr) == '[object Array]';
2516+
return toString.call(arr) == '[object Array]';
25162517
};
25172518

25182519

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "engine.io-client",
33
"description": "Client for the realtime Engine",
44
"license": "MIT",
5-
"version": "2.1.1",
5+
"version": "3.0.0",
66
"homepage": "https://github.com/socketio/engine.io-client",
77
"contributors": [
88
{
@@ -45,7 +45,7 @@
4545
"concat-stream": "^1.6.0",
4646
"del": "^2.2.2",
4747
"derequire": "^2.0.6",
48-
"engine.io": "2.1.1",
48+
"engine.io": "3.0.0",
4949
"eslint-config-standard": "4.4.0",
5050
"eslint-plugin-standard": "1.3.1",
5151
"expect.js": "^0.3.1",

0 commit comments

Comments
 (0)