From 43bb2eb23423d7dbec6e2bc6b2d7effd39d63997 Mon Sep 17 00:00:00 2001 From: Shawn Miller Date: Fri, 13 May 2022 10:54:00 -0500 Subject: [PATCH] Cannot read property 'toString' of undefined --- .eslintrc.js | 2 +- carriers/pitneyBowes.js | 4 ++-- package.json | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 09be4ef..d751b7a 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -6,7 +6,7 @@ module.exports = { }, extends: 'eslint:recommended', parserOptions: { - ecmaVersion: 2019 + ecmaVersion: 2022 }, rules: { 'brace-style': ['error', '1tbs', { allowSingleLine: true }], diff --git a/carriers/pitneyBowes.js b/carriers/pitneyBowes.js index bae9190..345f03c 100644 --- a/carriers/pitneyBowes.js +++ b/carriers/pitneyBowes.js @@ -117,11 +117,11 @@ function PitneyBowes(options) { return; } - if (DELIVERED_TRACKING_STATUS_CODES.includes(scanDetail.scanType.toString())) { + if (DELIVERED_TRACKING_STATUS_CODES.includes(scanDetail?.scanType?.toString())) { results.deliveredAt = new Date(event.date); } - if (SHIPPED_TRACKING_STATUS_CODES.includes(scanDetail.scanType.toString())) { + if (SHIPPED_TRACKING_STATUS_CODES.includes(scanDetail?.scanType?.toString())) { results.shippedAt = new Date(event.date); } diff --git a/package.json b/package.json index a5570a4..b9617cb 100644 --- a/package.json +++ b/package.json @@ -39,5 +39,5 @@ "type": "git", "url": "https://github.com/mediocre/bloodhound.git" }, - "version": "1.8.1" + "version": "1.8.2" }