@mediocre/bloodhound
Advanced tools
Comparing version 1.5.2 to 1.5.3
@@ -94,3 +94,4 @@ const async = require('async'); | ||
RequestAction: 'Track', | ||
RequestOption: 'activity' | ||
RequestOption: 'activity', | ||
SubVersion: '1907', | ||
} | ||
@@ -162,16 +163,13 @@ } | ||
async.mapLimit(Array.from(new Set(activitiesList.map(activity => activity.location))), 10, function(location, callback) { | ||
if (!location) { | ||
callback(); | ||
} else { | ||
geography.parseLocation(location, options, function(err, address) { | ||
if (err || !address) { | ||
return callback(err); | ||
} | ||
// Get the activity locations for all activities that don't have a GMTDate or GMTTime | ||
async.mapLimit(Array.from(new Set(activitiesList.filter(activity => (!activity.GMTDate || !activity.GMTTime) && activity.location).map(activity => activity.location))), 10, function(location, callback) { | ||
geography.parseLocation(location, options, function(err, address) { | ||
if (err || !address) { | ||
return callback(err); | ||
} | ||
address.location = location; | ||
address.location = location; | ||
callback(null, address); | ||
}); | ||
} | ||
callback(null, address); | ||
}); | ||
}, function(err, addresses) { | ||
@@ -197,6 +195,11 @@ if (err) { | ||
address: activity.address, | ||
date: moment.tz(`${activity.Date} ${activity.Time}`, 'YYYYMMDD HHmmss', timezone).toDate(), | ||
description: activity.Description || (activity.Status && activity.Status.Description) || (activity.Status && activity.Status.StatusType && activity.Status.StatusType.Description) | ||
}; | ||
if (activity.GMTDate && activity.GMTTime) { | ||
event.date = moment.tz(`${activity.GMTDate} ${activity.GMTTime}`, 'YYYY-MM-DD HH.mm.ss', 'UTC').toDate(); | ||
} else { | ||
event.date = moment.tz(`${activity.Date} ${activity.Time}`, 'YYYYMMDD HHmmss', timezone).toDate(); | ||
} | ||
// Ensure event is after minDate (used to prevent data from reused tracking numbers) | ||
@@ -203,0 +206,0 @@ if (event.date < _options.minDate) { |
@@ -42,3 +42,3 @@ { | ||
}, | ||
"version": "1.5.2" | ||
"version": "1.5.3" | ||
} |
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
67022
955