reactotron-core-client
Advanced tools
Comparing version 1.9.1 to 1.10.0
@@ -243,51 +243,3 @@ 'use strict'; | ||
var hasHirezNodeTimer = false && (typeof process === 'undefined' ? 'undefined' : _typeof(process)) === 'object' && process && process.hrtime && typeof process.hrtime === 'function'; | ||
// the default timer | ||
var defaultPerformanceNow = function defaultPerformanceNow() { | ||
return Date.now(); | ||
}; | ||
// try to find the browser-based performance timer | ||
var nativePerformance = typeof window !== 'undefined' && window && (window.performance || window.msPerformance || window.webkitPerformance); | ||
// if we do find it, let's setup to call it | ||
var nativePerformanceNow = function nativePerformanceNow() { | ||
return nativePerformance.now(); | ||
}; | ||
// the function we're trying to assign | ||
var performanceNow = defaultPerformanceNow; | ||
// accepts an already started time and returns the number of milliseconds | ||
var delta = function delta(started) { | ||
return performanceNow() - started; | ||
}; | ||
// node will use a high rez timer | ||
if (hasHirezNodeTimer) { | ||
performanceNow = process.hrtime; | ||
delta = function delta(started) { | ||
return performanceNow(started)[1] / 1000000; | ||
}; | ||
} else if (nativePerformance) { | ||
performanceNow = nativePerformanceNow; | ||
} | ||
// this is the interface the callers will use | ||
// export const performanceNow = nativePerformance ? nativePerformanceNow : defaultPerformanceNow | ||
/** | ||
* Starts a lame, low-res timer. Returns a function which when invoked, | ||
* gives you the number of milliseconds since passing. ish. | ||
*/ | ||
var start = function start() { | ||
// record the start time | ||
var started = performanceNow(); | ||
return function () { | ||
return delta(started); | ||
}; | ||
}; | ||
/** | ||
* Attempts to give a name to a function. | ||
@@ -345,2 +297,50 @@ * | ||
var hasHirezNodeTimer = false && (typeof process === 'undefined' ? 'undefined' : _typeof(process)) === 'object' && process && process.hrtime && typeof process.hrtime === 'function'; | ||
// the default timer | ||
var defaultPerformanceNow = function defaultPerformanceNow() { | ||
return Date.now(); | ||
}; | ||
// try to find the browser-based performance timer | ||
var nativePerformance = typeof window !== 'undefined' && window && (window.performance || window.msPerformance || window.webkitPerformance); | ||
// if we do find it, let's setup to call it | ||
var nativePerformanceNow = function nativePerformanceNow() { | ||
return nativePerformance.now(); | ||
}; | ||
// the function we're trying to assign | ||
var performanceNow = defaultPerformanceNow; | ||
// accepts an already started time and returns the number of milliseconds | ||
var delta = function delta(started) { | ||
return performanceNow() - started; | ||
}; | ||
// node will use a high rez timer | ||
if (hasHirezNodeTimer) { | ||
performanceNow = process.hrtime; | ||
delta = function delta(started) { | ||
return performanceNow(started)[1] / 1000000; | ||
}; | ||
} else if (nativePerformance) { | ||
performanceNow = nativePerformanceNow; | ||
} | ||
// this is the interface the callers will use | ||
// export const performanceNow = nativePerformance ? nativePerformanceNow : defaultPerformanceNow | ||
/** | ||
* Starts a lame, low-res timer. Returns a function which when invoked, | ||
* gives you the number of milliseconds since passing. ish. | ||
*/ | ||
var start = function start() { | ||
// record the start time | ||
var started = performanceNow(); | ||
return function () { | ||
return delta(started); | ||
}; | ||
}; | ||
var CorePlugins = [image(), logger(), benchmark(), stateResponses(), apiResponse(), clear()]; | ||
@@ -396,3 +396,2 @@ | ||
// the configuration options | ||
@@ -513,3 +512,3 @@ | ||
// wire. | ||
var actualPayload = JSON.parse(serialize(payload)); | ||
var actualPayload = this.options.safeRecursion ? JSON.parse(serialize(payload)) : payload; | ||
@@ -516,0 +515,0 @@ // send this command |
{ | ||
"name": "reactotron-core-client", | ||
"version": "1.9.1", | ||
"version": "1.10.0", | ||
"description": "Grants Reactotron clients the ability to talk to a Reactotron server.", | ||
@@ -27,14 +27,14 @@ "main": "dist/index.js", | ||
"devDependencies": { | ||
"ava": "^0.18.1", | ||
"babel-cli": "^6.22.2", | ||
"babel-core": "^6.22.1", | ||
"babel-eslint": "^7.1.0", | ||
"babel-preset-es2015": "^6.22.0", | ||
"ava": "^0.19.1", | ||
"babel-cli": "^6.24.1", | ||
"babel-core": "^6.24.1", | ||
"babel-eslint": "^7.2.2", | ||
"babel-preset-es2015": "^6.24.1", | ||
"babel-preset-es2015-rollup": "^3.0.0", | ||
"babel-preset-stage-1": "^6.22.0", | ||
"nyc": "^10.1.2", | ||
"rollup": "^0.41.4", | ||
"babel-preset-stage-1": "^6.24.1", | ||
"nyc": "^10.2.0", | ||
"rollup": "^0.41.6", | ||
"rollup-plugin-babel": "^2.6.1", | ||
"standard": "^8.0.0", | ||
"socket.io": "^1.7.0" | ||
"socket.io": "^1.7.3", | ||
"standard": "^10.0.2" | ||
}, | ||
@@ -41,0 +41,0 @@ "ava": { |
Sorry, the diff of this file is not supported yet
32741