on-performance
Advanced tools
Comparing version 1.2.1 to 1.2.2
17
index.js
@@ -35,6 +35,11 @@ var assert = require('assert') | ||
var observer = new PerformanceObserver(parseEntries) | ||
setTimeout(function () { | ||
parseEntries(performance) | ||
// Only necessary in Node >=8.5 <10, Node 10+ doesn't have a global buffer | ||
if (performance.getEntries) { | ||
setTimeout(function () { | ||
parseEntries(performance) | ||
observer.observe({ entryTypes: entryTypes }) | ||
}, 0) | ||
} else { | ||
observer.observe({ entryTypes: entryTypes }) | ||
}, 0) | ||
} | ||
@@ -58,6 +63,6 @@ return stop | ||
var type = entry.entryType | ||
if (type === 'measure') performance.clearMeasures(entry.name) | ||
else if (type === 'mark') performance.clearMarks(entry.name) | ||
else if (type === 'function') performance.clearFunctions(entry.name) | ||
// Only necessary in Node >=8.5 <10, Node 10+ doesn't have a global buffer | ||
if (type === 'measure' && performance.clearMeasures) performance.clearMeasures(entry.name) | ||
else if (type === 'function' && performance.clearFunctions) performance.clearFunctions(entry.name) | ||
} | ||
} |
@@ -10,6 +10,6 @@ { | ||
}, | ||
"version": "1.2.1", | ||
"version": "1.2.2", | ||
"scripts": { | ||
"start": "bankai start test.js", | ||
"test": "standard && browserify test | tape-run" | ||
"start": "bankai start test/browser.js", | ||
"test": "standard && node test && browserify test/browser | tape-run" | ||
}, | ||
@@ -21,9 +21,9 @@ "dependencies": { | ||
"devDependencies": { | ||
"bankai": "^8.0.0", | ||
"browserify": "^14.4.0", | ||
"dependency-check": "^2.8.0", | ||
"nanotiming": "^5.2.1", | ||
"standard": "^10.0.2", | ||
"tape": "^4.6.3", | ||
"tape-run": "^3.0.0" | ||
"bankai": "^9.12.0", | ||
"browserify": "^16.2.2", | ||
"dependency-check": "^3.1.0", | ||
"nanotiming": "^7.3.1", | ||
"standard": "^11.0.1", | ||
"tape": "^4.9.0", | ||
"tape-run": "^4.0.0" | ||
}, | ||
@@ -30,0 +30,0 @@ "keywords": [ |
Sorry, the diff of this file is not supported yet
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
8618
8
154
4