Skip to content

Commit 8a40349

Browse files
authored
fix: symbolRegex in isStrongPassword to include '\' (#2278)
* Modified symbolRegex in isStrongPassword to include '\' * Modify test to check validity of strong password with \ character
1 parent 2253a77 commit 8a40349

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/lib/isStrongPassword.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import assertString from './util/assertString';
44
const upperCaseRegex = /^[A-Z]$/;
55
const lowerCaseRegex = /^[a-z]$/;
66
const numberRegex = /^[0-9]$/;
7-
const symbolRegex = /^[-#!$@£%^&*()_+|~=`{}\[\]:";'<>?,.\/ ]$/;
7+
const symbolRegex = /^[-#!$@£%^&*()_+|~=`{}\[\]:";'<>?,.\/\\ ]$/;
88

99
const defaultOptions = {
1010
minLength: 8,

test/validators.test.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13020,6 +13020,7 @@ describe('Validators', () => {
1302013020
'+&DxJ=X7-4L8jRCD',
1302113021
'etV*p%Nr6w&H%FeF',
1302213022
'£3.ndSau_7',
13023+
'VaLIDWith\\Symb0l',
1302313024
],
1302413025
invalid: [
1302513026
'',

0 commit comments

Comments
 (0)