mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-14 08:29:55 +00:00
Convert JS to TS
This commit is contained in:
+11
-8
@@ -1,18 +1,21 @@
|
||||
interface PasswordCheckProps {
|
||||
password: string;
|
||||
currentErrorCheck: boolean;
|
||||
setPasswordErrorLength: (value: boolean) => void;
|
||||
setPasswordErrorNumber: (value: boolean) => void;
|
||||
setPasswordErrorLowerCase: (value: boolean) => void;
|
||||
}
|
||||
|
||||
/**
|
||||
* This function checks a user password with respect to some criteria.
|
||||
* @param {*} password
|
||||
* @param {*} setPasswordError
|
||||
* @param {*} setPasswordErrorMessage
|
||||
* @param {*} currentErrorCheck
|
||||
* @returns
|
||||
*/
|
||||
const passwordCheck = (
|
||||
const passwordCheck = ({
|
||||
password,
|
||||
setPasswordErrorLength,
|
||||
setPasswordErrorNumber,
|
||||
setPasswordErrorLowerCase,
|
||||
currentErrorCheck
|
||||
) => {
|
||||
currentErrorCheck,
|
||||
}: PasswordCheckProps) => {
|
||||
let errorCheck = currentErrorCheck;
|
||||
if (!password || password.length < 14) {
|
||||
setPasswordErrorLength(true);
|
||||
@@ -0,0 +1,11 @@
|
||||
// this function is temporary until. have to create error handling logic for localStorage and delete this.
|
||||
export const tempLocalStorage = (key: string) => {
|
||||
const value = localStorage.getItem(key);
|
||||
|
||||
if (value === null || value === "") {
|
||||
console.warn("No value found in localStorage for key");
|
||||
return "";
|
||||
}
|
||||
|
||||
return value;
|
||||
};
|
||||
Reference in New Issue
Block a user