{"ScriptPreparationCode":"requirements = [\r\n \u0027hasNumber\u0027,\r\n \u0027hasSpecialChar\u0027,\r\n \u0027hasUppercaseLetter\u0027\r\n];\r\n\r\npasswordRequirements = [\r\n {\r\n key: \u0027hasNumber\u0027,\r\n label: \u0022Has a number 0-9\u0022,\r\n validate: password =\u003E {\r\n const trimmedPassword = password.trim();\r\n\r\n if (trimmedPassword \u0026\u0026 trimmedPassword.length) {\r\n return /[0-9]/.test(trimmedPassword);\r\n }\r\n\r\n return false;\r\n }\r\n },\r\n {\r\n key: \u0027hasSpecialChar\u0027,\r\n label: \u0022Has a special char !@#$%^\u0026*\u0022,\r\n validate: password =\u003E {\r\n const trimmedPassword = password.trim();\r\n\r\n if (trimmedPassword \u0026\u0026 trimmedPassword.length) {\r\n return /[!@#$%^\u0026*]/.test(trimmedPassword);\r\n }\r\n\r\n return false;\r\n }\r\n },\r\n {\r\n key: \u0027hasUppercaseLetter\u0027,\r\n label: \u0022Has uppercase Letter\u0022,\r\n validate: password =\u003E {\r\n const trimmedPassword = password.trim();\r\n\r\n if (trimmedPassword \u0026\u0026 trimmedPassword.length) {\r\n return /[A-Z]/.test(trimmedPassword);\r\n }\r\n\r\n return false;\r\n }\r\n }\r\n];","TestCases":[{"Name":"Filter","Code":"passwordRequirements.filter(pwdReq =\u003E requirements.includes(pwdReq.key));","IsDeferred":false},{"Name":"Set","Code":"set2 = new Set(requirements);\r\npasswordRequirements.filter(element =\u003E set2.has(element.key));","IsDeferred":false}]}