Type Alias: ExportedCookie โ
ExportedCookie:
z.infer
<typeofExportedCookieSchema
>
Defined in: src/types/schemas.ts:296
Type definition for exported cookie data Represents the structure of a cookie after it has been retrieved
Example โ
typescript
// Basic exported cookie
const cookie: ExportedCookie = {
domain: 'example.com',
name: 'session',
value: 'abc123',
expiry: new Date('2024-12-31'),
meta: {
file: '/path/to/cookies.db'
}
};
// Process exported cookies
function processCookies(cookies: ExportedCookie[]): string[] {
return cookies.map(cookie => `${cookie.name}=${cookie.value}`);
}
// Filter expired cookies
function filterExpired(cookies: ExportedCookie[]): ExportedCookie[] {
const now = new Date();
return cookies.filter(cookie =>
cookie.expiry === "Infinity" ||
(cookie.expiry instanceof Date && cookie.expiry > now)
);
}