diff --git a/.travis.yml b/.travis.yml index 88e3a82..6e7380e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,6 @@ language: node_js node_js: + - "12.18.2" - "6.1" - "5.11" - "4.4.6" diff --git a/CHANGELOG.md b/CHANGELOG.md index dc7ff2f..6db5d0c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +# 2.4.3 +* fixed an issue of UPS that always marked as InTransit + # 2.4.2 * update eparcel check point area diff --git a/lib/courier/ups.js b/lib/courier/ups.js index d5f3c36..817dfaf 100644 --- a/lib/courier/ups.js +++ b/lib/courier/ups.js @@ -55,11 +55,15 @@ module.exports = function (opts) { var checkpoint = { courier: courier, location: current.location, - message: current.activityScan, + message: current.activityScan.trim(), status: tracker.STATUS.IN_TRANSIT, time: moment([current.date, current.time].join(' '), 'YYYY/MM/DD HH:mm').format('YYYY-MM-DDTHH:mm') } + if (checkpoint.message.indexOf('DELIVERED') !== -1) { + checkpoint.status = tracker.STATUS.DELIVERED + } + checkpoints.push(checkpoint) } diff --git a/package.json b/package.json index ac535ba..a40afb9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "delivery-tracker", - "version": "2.4.2", + "version": "2.4.3", "author": { "name": "egg", "email": "i@egg.pe.kr"