Skip to content

Commit

Permalink
[chore] Release 3.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
darrachequesne committed May 19, 2017
1 parent 11f3fdd commit b949abc
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 43 deletions.
6 changes: 6 additions & 0 deletions History.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@

3.1.1 / 2017-05-19
===================

* [test] Launch browser tests on localhost by default (#571)
* [chore] Unpin debug version (#568)

3.1.0 / 2017-04-28
===================

Expand Down
87 changes: 45 additions & 42 deletions engine.io.js
Original file line number Diff line number Diff line change
Expand Up @@ -3364,20 +3364,20 @@ return /******/ (function(modules) { // webpackBootstrap
// NB: In an Electron preload script, document will be defined but not fully
// initialized. Since we know we're in Chrome, we'll just detect this case
// explicitly
if (typeof window !== 'undefined' && window && typeof window.process !== 'undefined' && window.process.type === 'renderer') {
if (typeof window !== 'undefined' && window.process && window.process.type === 'renderer') {
return true;
}

// is webkit? http://stackoverflow.com/a/16459606/376773
// document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
return (typeof document !== 'undefined' && document && 'WebkitAppearance' in document.documentElement.style) ||
return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||
// is firebug? http://stackoverflow.com/a/398120/376773
(typeof window !== 'undefined' && window && window.console && (console.firebug || (console.exception && console.table))) ||
(typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||
// is firefox >= v31?
// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
(typeof navigator !== 'undefined' && navigator && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||
(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||
// double check webkit in userAgent just in case we are in a worker
(typeof navigator !== 'undefined' && navigator && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/));
(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/));
}

/**
Expand Down Expand Up @@ -3916,11 +3916,11 @@ return /******/ (function(modules) { // webpackBootstrap
* Helpers.
*/

var s = 1000
var m = s * 60
var h = m * 60
var d = h * 24
var y = d * 365.25
var s = 1000;
var m = s * 60;
var h = m * 60;
var d = h * 24;
var y = d * 365.25;

/**
* Parse or format the given `val`.
Expand All @@ -3936,18 +3936,19 @@ return /******/ (function(modules) { // webpackBootstrap
* @api public
*/

module.exports = function (val, options) {
options = options || {}
var type = typeof val
module.exports = function(val, options) {
options = options || {};
var type = typeof val;
if (type === 'string' && val.length > 0) {
return parse(val)
return parse(val);
} else if (type === 'number' && isNaN(val) === false) {
return options.long ?
fmtLong(val) :
fmtShort(val)
return options.long ? fmtLong(val) : fmtShort(val);
}
throw new Error('val is not a non-empty string or a valid number. val=' + JSON.stringify(val))
}
throw new Error(
'val is not a non-empty string or a valid number. val=' +
JSON.stringify(val)
);
};

/**
* Parse the given `str` and return milliseconds.
Expand All @@ -3958,53 +3959,55 @@ return /******/ (function(modules) { // webpackBootstrap
*/

function parse(str) {
str = String(str)
if (str.length > 10000) {
return
str = String(str);
if (str.length > 100) {
return;
}
var match = /^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(str)
var match = /^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(
str
);
if (!match) {
return
return;
}
var n = parseFloat(match[1])
var type = (match[2] || 'ms').toLowerCase()
var n = parseFloat(match[1]);
var type = (match[2] || 'ms').toLowerCase();
switch (type) {
case 'years':
case 'year':
case 'yrs':
case 'yr':
case 'y':
return n * y
return n * y;
case 'days':
case 'day':
case 'd':
return n * d
return n * d;
case 'hours':
case 'hour':
case 'hrs':
case 'hr':
case 'h':
return n * h
return n * h;
case 'minutes':
case 'minute':
case 'mins':
case 'min':
case 'm':
return n * m
return n * m;
case 'seconds':
case 'second':
case 'secs':
case 'sec':
case 's':
return n * s
return n * s;
case 'milliseconds':
case 'millisecond':
case 'msecs':
case 'msec':
case 'ms':
return n
return n;
default:
return undefined
return undefined;
}
}

Expand All @@ -4018,18 +4021,18 @@ return /******/ (function(modules) { // webpackBootstrap

function fmtShort(ms) {
if (ms >= d) {
return Math.round(ms / d) + 'd'
return Math.round(ms / d) + 'd';
}
if (ms >= h) {
return Math.round(ms / h) + 'h'
return Math.round(ms / h) + 'h';
}
if (ms >= m) {
return Math.round(ms / m) + 'm'
return Math.round(ms / m) + 'm';
}
if (ms >= s) {
return Math.round(ms / s) + 's'
return Math.round(ms / s) + 's';
}
return ms + 'ms'
return ms + 'ms';
}

/**
Expand All @@ -4045,7 +4048,7 @@ return /******/ (function(modules) { // webpackBootstrap
plural(ms, h, 'hour') ||
plural(ms, m, 'minute') ||
plural(ms, s, 'second') ||
ms + ' ms'
ms + ' ms';
}

/**
Expand All @@ -4054,12 +4057,12 @@ return /******/ (function(modules) { // webpackBootstrap

function plural(ms, n, name) {
if (ms < n) {
return
return;
}
if (ms < n * 1.5) {
return Math.floor(ms / n) + ' ' + name
return Math.floor(ms / n) + ' ' + name;
}
return Math.ceil(ms / n) + ' ' + name + 's'
return Math.ceil(ms / n) + ' ' + name + 's';
}


Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "engine.io-client",
"description": "Client for the realtime Engine",
"license": "MIT",
"version": "3.1.0",
"version": "3.1.1",
"homepage": "https://github.com/socketio/engine.io-client",
"contributors": [
{
Expand Down

0 comments on commit b949abc

Please sign in to comment.