Skip to content

Commit f270478

Browse files
author
calvin
committed
feat: modified part_c.ts file
1 parent 376a16e commit f270478

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

lesson_07/conditionals/src/part_c.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,23 @@
66
* @returns
77
*/
88
export function isStrongPassword(password: string): boolean {
9+
if (password.length < 8) {
10+
11+
return false;
12+
}
13+
if (!/[A-Z]/.test(password)) {
14+
15+
return false;
16+
}
17+
if (!/[0-9]/.test(password)) {
18+
919
return false;
20+
}
21+
22+
if (password.length >= 8 ){
23+
24+
return true;
25+
1026
}
1127

1228
/**

0 commit comments

Comments
 (0)