Skip to content

Commit

Permalink
add toUpperCase to guessCarrier
Browse files Browse the repository at this point in the history
  • Loading branch information
Jenny committed Jul 25, 2019
1 parent f426131 commit 05b6d7c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions carriers/ups.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ function UPS(options) {
this.isTrackingNumberValid = function(trackingNumber) {
// Remove whitespace
trackingNumber = trackingNumber.replace(/\s/g, '');
trackingNumber = trackingNumber.toUpperCase();

// https://www.ups.com/us/en/tracking/help/tracking/tnh.page
if (/^1Z[0-9A-Z]{16}$/.test(trackingNumber)) {
Expand Down
3 changes: 2 additions & 1 deletion test/carriers/ups.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ describe('UPS', function() {
'1Z12345E5991872040',
'1Z12345E0390105056',
'1Z12345E0290424025',
'1Z12345E0194845039'
'1Z12345E0194845039',
'1z3913yy0344313151'
];

const invalidTrackingNumbers = [
Expand Down

0 comments on commit 05b6d7c

Please sign in to comment.