fleetmap-reports 1.0.864 → 1.0.865

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.864",
3
+ "version": "1.0.865",
4
4
  "description": "",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -352,11 +352,11 @@ async function getOSMSpeedingEvents (devices, routes, threshold, minimumMinutes
352
352
  }
353
353
  const reduced = results.reduce((acc, cur, idx, src) => {
354
354
  const last = acc.length && acc.slice(-1)[0]
355
- if (last && new Date(cur.fixTime) - new Date(src[idx - 1]) < 1000 * 60 * 2) {
355
+ if (last && new Date(cur.fixTime) - new Date(src[idx - 1].fixTime) < 1000 * 60 * 2) {
356
356
  last.eventTime = new Date(cur.fixTime) - new Date(last.fixTime)
357
357
  last.attributes.maxSpeed = Math.max(last.attributes.maxSpeed, cur.speed)
358
358
  last.distance += distance.default(point([cur.longitude, cur.latitude]), point([src[idx - 1].longitude, src[idx - 1].latitude]))
359
- } else if (cur.overSpeeding) {
359
+ } else {
360
360
  cur.positionId = cur && cur.id
361
361
  cur.roadSpeedLimit = cur.speed_limit
362
362
  cur.deviceId = d.id