@elysiajs/cookie
Advanced tools
Comparing version 0.1.1 to 0.3.0-rc.3
@@ -15,3 +15,3 @@ import type { Elysia } from 'elysia'; | ||
export declare const cookie: ({ signed, secret: secretKey, ...defaultOptions }?: CookieOptions) => (app: Elysia) => Elysia<{ | ||
store: Record<any, any> & Record<typeof import("elysia").SCHEMA, {}> & Record<typeof import("elysia").DEFS, {}>; | ||
store: Record<string, unknown>; | ||
request: { | ||
@@ -27,3 +27,4 @@ unsignCookie: (value: string) => { | ||
schema: {}; | ||
meta: Record<typeof import("elysia").SCHEMA, {}> & Record<typeof import("elysia").DEFS, {}> & Record<typeof import("elysia").EXPOSED, {}>; | ||
}>; | ||
export default cookie; |
@@ -30,3 +30,3 @@ import { serialize, parse } from 'cookie'; | ||
})) | ||
.inject((context) => { | ||
.derive((context) => { | ||
let _cookie; | ||
@@ -55,3 +55,3 @@ const getCookie = () => { | ||
} | ||
if (!context.set.headers['Set-Cookie']) | ||
if (!Array.isArray(context.set.headers['Set-Cookie'])) | ||
context.set.headers['Set-Cookie'] = []; | ||
@@ -58,0 +58,0 @@ context.set.headers['Set-Cookie'].push(serialize(name, value, { |
{ | ||
"name": "@elysiajs/cookie", | ||
"version": "0.1.1", | ||
"version": "0.3.0-rc.3", | ||
"description": "Plugin for Elysia that add supports for get/set cookie", | ||
@@ -42,3 +42,3 @@ "author": { | ||
"peerDependencies": { | ||
"elysia": ">= 0.2.6" | ||
"elysia": ">= 0.3.0-rc.3" | ||
}, | ||
@@ -48,3 +48,3 @@ "devDependencies": { | ||
"bun-types": "^0.5.0", | ||
"elysia": "0.2.6", | ||
"elysia": "0.3.0-rc.4", | ||
"eslint": "^8.26.0", | ||
@@ -51,0 +51,0 @@ "rimraf": "^3.0.2", |
@@ -72,3 +72,3 @@ import type { Elysia, Handler } from 'elysia' | ||
}) | ||
.inject((context) => { | ||
.derive((context) => { | ||
let _cookie: Record<string, string> | ||
@@ -109,3 +109,3 @@ | ||
if (!context.set.headers['Set-Cookie']) | ||
if (!Array.isArray(context.set.headers['Set-Cookie'])) | ||
// @ts-ignore | ||
@@ -112,0 +112,0 @@ context.set.headers['Set-Cookie'] = [] |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
17489
224