feat adding a validator for the cookie

This commit is contained in:
Tobi Saputra 2025-05-13 18:25:38 +07:00
parent 4dda8daf85
commit a19dd9c062

6
src/utils/validator.ts Normal file
View File

@ -0,0 +1,6 @@
export const validateCookie = (cookie: string | any[]): boolean => {
if (!cookie) return false
if (typeof cookie === "string") return cookie.length > 0
if (Array.isArray(cookie)) return cookie.length > 0
return false
}