universal-parcel-scraper 0.7.2-main.328 → 0.7.2-main.329
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.
|
@@ -63,6 +63,11 @@ export function trackingPlace(location) {
|
|
|
63
63
|
if (country)
|
|
64
64
|
return { country, place: kept ? text.slice(0, fields[kept].index).replace(/[\s,;|(]+$/u, '') : '' };
|
|
65
65
|
if (fields.length === 1 && text === fields[0][0]) {
|
|
66
|
+
// Aggregators can name a DHL country operation instead of a town.
|
|
67
|
+
const operation = /^DHL\s+(.+)$/i.exec(text);
|
|
68
|
+
const operationCountry = operation ? namedCountry(operation[1], true) : null;
|
|
69
|
+
if (operationCountry)
|
|
70
|
+
return { country: operationCountry, place: '' };
|
|
66
71
|
const words = text.split(/\s+/);
|
|
67
72
|
for (let count = Math.min(words.length - 1, 4); count > 0; count -= 1) {
|
|
68
73
|
const code = namedCountry(words.slice(0, count).join(' '), true);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "universal-parcel-scraper",
|
|
3
|
-
"version": "0.7.2-main.
|
|
3
|
+
"version": "0.7.2-main.329",
|
|
4
4
|
"description": "Self-hosted parcel tracking: carrier detection, dedicated scrapers and optional universal providers.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "Apache-2.0",
|