@contrast/library-analysis
Advanced tools
Comparing version 1.20.3 to 1.21.0
@@ -25,2 +25,4 @@ /* | ||
const MAX_TS_OBSERVATIONS_PER_POST = 100; | ||
module.exports = function init(core) { | ||
@@ -89,4 +91,6 @@ const { config, logger, messages } = core; | ||
libraryUsage.report = function () { | ||
const eventsToSend = []; | ||
let count = 0; | ||
for (const info of bufferedEvents) { | ||
messages.emit(Event.LIBRARY_USAGE, { | ||
eventsToSend.push({ | ||
id: info.hash, | ||
@@ -96,3 +100,13 @@ names: Array.from(info.names), | ||
bufferedEvents.delete(info); | ||
if (++count >= MAX_TS_OBSERVATIONS_PER_POST) { | ||
messages.emit(Event.LIBRARY_USAGE, eventsToSend); | ||
eventsToSend.length = 0; | ||
count = 0; | ||
} | ||
} | ||
// any leftovers? | ||
if (eventsToSend.length) { | ||
messages.emit(Event.LIBRARY_USAGE, eventsToSend); | ||
} | ||
}; | ||
@@ -99,0 +113,0 @@ |
{ | ||
"name": "@contrast/library-analysis", | ||
"version": "1.20.3", | ||
"version": "1.21.0", | ||
"description": "Handles library reporting and library usage analysis", | ||
@@ -21,3 +21,3 @@ "license": "SEE LICENSE IN LICENSE", | ||
"@contrast/code-events": "^3.0.0", | ||
"@contrast/common": "1.21.3", | ||
"@contrast/common": "1.22.0", | ||
"@contrast/find-package-json": "^1.1.0", | ||
@@ -24,0 +24,0 @@ "semver": "^7.3.8" |
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
17523
452
+ Added@contrast/common@1.22.0(transitive)
- Removed@contrast/common@1.21.3(transitive)
Updated@contrast/common@1.22.0