Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/lib/isISO6346.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
4 changes: 2 additions & 2 deletions src/lib/isRgbColor.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
import assertString from './util/assertString';

const rgbColor = /^rgb\((([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5]),){2}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\)$/;
const rgbaColor = /^rgba\((([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5]),){3}(0?\.\d\d?|1(\.0)?|0(\.0)?)\)$/;
const rgbaColor = /^rgba\((([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5]),){3}(0(\.\d+)?|1(\.0+)?|\.\d+)\)$/;
const rgbColorPercent = /^rgb\((([0-9]%|[1-9][0-9]%|100%),){2}([0-9]%|[1-9][0-9]%|100%)\)$/;
const rgbaColorPercent = /^rgba\((([0-9]%|[1-9][0-9]%|100%),){3}(0?\.\d\d?|1(\.0)?|0(\.0)?)\)$/;
const rgbaColorPercent = /^rgba\((([0-9]%|[1-9][0-9]%|100%),){3}(0(\.\d+)?|1(\.0+)?|\.\d+)\)$/;
const startsWithRgb = /^rgba?/;

export default function isRgbColor(str, options) {
Expand Down
2 changes: 1 addition & 1 deletion src/lib/normalizeEmail.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const default_normalize_email_options = {
gmail_remove_dots: true,
// Removes the subaddress (e.g. "+foo") from the email address
gmail_remove_subaddress: true,
// Conversts the googlemail.com domain to gmail.com
// Converts the googlemail.com domain to gmail.com
gmail_convert_googlemaildotcom: true,

// The following conversions are specific to Outlook.com / Windows Live / Hotmail
Expand Down
16 changes: 14 additions & 2 deletions test/validators.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -5122,6 +5122,10 @@ describe('Validators', () => {
'rgb(5%,5%,5%)',
'rgba(5%,5%,5%,.3)',
'rgba(5%,5%,5%,.32)',
'rgba(255,255,255,.123)',
'rgba(5%,5%,5%,.321)',
'rgba(0,0,0,1.00)',
'rgba(0,0,0,0.12345)',
],
invalid: [
'rgb(0,0,0,)',
Expand All @@ -5130,12 +5134,10 @@ describe('Validators', () => {
'rgb()',
'rgba(0,0,0)',
'rgba(255,255,255,2)',
'rgba(255,255,255,.123)',
'rgba(255,255,256,0.1)',
'rgb(4,4,5%)',
'rgba(5%,5%,5%)',
'rgba(3,3,3%,.3)',
'rgba(5%,5%,5%,.321)',
'rgb(101%,101%,101%)',
'rgba(3%,3%,101%,0.3)',
'rgb(101%,101%,101%) additional invalid string part',
Expand Down Expand Up @@ -13542,6 +13544,11 @@ describe('Validators', () => {
'ECMJ4657496',
'TBJA7176445',
'AFFU5962593',
'abcHLXU2008419',
'HLXU2008419abc',
'abcQJRZ123456',
'QJRZ123456abc',
'QJR,123456',
],
});
});
Expand All @@ -13567,6 +13574,11 @@ describe('Validators', () => {
'ECMJ4657496',
'TBJA7176445',
'AFFU5962593',
'abcHLXU2008419',
'HLXU2008419abc',
'abcQJRZ123456',
'QJRZ123456abc',
'QJR,123456',
],
});
});
Expand Down
Loading