We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 173dc0a commit 9a25d7aCopy full SHA for 9a25d7a
src/index.js
@@ -205,19 +205,13 @@ class Saturn {
205
* @param {Array<object>} logs
206
*/
207
_matchLogsWithPerformanceMetrics (logs) {
208
- const logsToReport = []
209
-
210
- for (const log of logs) {
211
- const metrics = this._getPerformanceMetricsForLog(log)
212
213
- if (!metrics.isFromBrowserCache) {
214
- delete metrics.isFromBrowserCache
215
- Object.assign(log, metrics)
216
- logsToReport.push(log)
217
- }
218
219
220
- return logsToReport
+ return logs
+ .map(log => ({ ...log, ...this._getPerformanceMetricsForLog(log) }))
+ .filter(log => !log.isFromBrowserCache)
+ .map(log => {
+ const { isFromBrowserCache: _, ...cleanLog } = log
+ return cleanLog
+ })
221
}
222
223
/**
0 commit comments