diff --git a/src/lib/isISO6346.js b/src/lib/isISO6346.js index 2c28c1123..cb6ac7b32 100644 --- a/src/lib/isISO6346.js +++ b/src/lib/isISO6346.js @@ -3,7 +3,7 @@ import assertString from './util/assertString'; // https://en.wikipedia.org/wiki/ISO_6346 // according to ISO6346 standard, checksum digit is mandatory for freight container but recommended // for other container types (J and Z) -const isISO6346Str = /^[A-Z]{3}(U[0-9]{7})|([J,Z][0-9]{6,7})$/; +const isISO6346Str = /^[A-Z]{3}(U[0-9]{7}|[JZ][0-9]{6,7})$/; const isDigit = /^[0-9]$/; export function isISO6346(str) { diff --git a/test/validators.test.js b/test/validators.test.js index a4c3d7193..5c0d424d0 100644 --- a/test/validators.test.js +++ b/test/validators.test.js @@ -13537,6 +13537,10 @@ describe('Validators', () => { 'ECMJ4657496', 'TBJA7176445', 'AFFU5962593', + 'ABCU1234567HELLO', + 'CSQU3054383XXX', + 'hellozZ123456', + 'AB,123456', ], }); }); @@ -13562,6 +13566,10 @@ describe('Validators', () => { 'ECMJ4657496', 'TBJA7176445', 'AFFU5962593', + 'ABCU1234567HELLO', + 'CSQU3054383XXX', + 'hellozZ123456', + 'AB,123456', ], }); });