feat adding a validator for the cookie
This commit is contained in:
parent
4dda8daf85
commit
a19dd9c062
6
src/utils/validator.ts
Normal file
6
src/utils/validator.ts
Normal 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
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user