File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -61,10 +61,10 @@ export default ({
6161 const errors = [ ] ;
6262
6363 if ( typeof value === 'string' ) {
64- const lowercaseCount = ( value . match ( / [ a - z ] / g) || [ ] ) . length ;
65- const upperCaseCount = ( value . match ( / [ A - Z ] / g) || [ ] ) . length ;
66- const numericCount = ( value . match ( / [ 0 - 9 ] / g) || [ ] ) . length ;
67- const symbolCount = ( value . match ( / [ ^ a - z A - Z 0 - 9 ] / g) || [ ] ) . length ;
64+ const lowercaseCount = value . match ( / [ a - z ] / g) ? .length ?? 0 ;
65+ const upperCaseCount = value . match ( / [ A - Z ] / g) ? .length ?? 0 ;
66+ const numericCount = value . match ( / [ 0 - 9 ] / g) ? .length ?? 0 ;
67+ const symbolCount = value . match ( / [ ^ a - z A - Z 0 - 9 ] / g) ? .length ?? 0 ;
6868
6969 const meetsMin = min && value . length >= min ;
7070 const meetsMax = max && value . length <= max ;
You can’t perform that action at this time.
0 commit comments