fleetmap-reports 1.0.293 → 1.0.295

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fleetmap-reports",
3
- "version": "1.0.293",
3
+ "version": "1.0.295",
4
4
  "description": "",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -260,7 +260,7 @@ async function getHereEvents(devices, routes, threshold){
260
260
  console.log('empty array after filter on device', d.name)
261
261
  continue
262
262
  }
263
- const reduced = hereAlerts.reduce((acc, cur, idx, src) => {
263
+ const reduced = hereAlerts.length < 2 ? hereAlerts : hereAlerts.reduce((acc, cur, idx, src) => {
264
264
  if (idx === 1) {
265
265
  return [cur]
266
266
  }
@@ -271,7 +271,7 @@ async function getHereEvents(devices, routes, threshold){
271
271
  })
272
272
  events.push(...reduced)
273
273
  } catch (e) {
274
- console.error(hereAlerts, e)
274
+ console.error(hereAlerts, 'threshold', threshold, e)
275
275
  }
276
276
  }
277
277
  return events