delivery-tracker
Advanced tools
Comparing version 0.9.3 to 0.9.4
@@ -0,1 +1,4 @@ | ||
# 0.9.4 | ||
* Added exception logic for unaligned shipping information. | ||
# 0.9.3 | ||
@@ -2,0 +5,0 @@ * add a status value to the rincos checkpoint message information. |
@@ -102,7 +102,8 @@ 'use strict' | ||
var status = STATUS.PENDING | ||
var isDelivered = false | ||
var latestCheckpoint = null | ||
for (var i = 0; i < checkpoints.length; i++) { | ||
if (checkpoints[i].time) { | ||
isDelivered = isDelivered || checkpoints[i].status === STATUS.DELIVERED | ||
if ((checkpoints[i].status === STATUS.DELIVERED || latestCheckpoint === null) && checkpoints[i].time) { | ||
latestCheckpoint = checkpoints[i] | ||
break | ||
} | ||
@@ -112,3 +113,5 @@ } | ||
if (latestCheckpoint) { | ||
status = latestCheckpoint.status | ||
// Last checkpoint information is not final information. | ||
// The order may be mixed when the local delivery company progresses. | ||
status = isDelivered ? STATUS.DELIVERED : latestCheckpoint.status | ||
@@ -115,0 +118,0 @@ if ([STATUS.IN_TRANSIT, STATUS.FAIL_ATTEMPT].indexOf(status) !== -1) { |
{ | ||
"name": "delivery-tracker", | ||
"version": "0.9.3", | ||
"version": "0.9.4", | ||
"author": { | ||
@@ -5,0 +5,0 @@ "name": "egg", |
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
38623
956