+24
-21
@@ -16,3 +16,3 @@ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } | ||
| } | ||
| head.headers.append("Set-Cookie", header); | ||
| return head.headers.append("Set-Cookie", header); | ||
| } | ||
@@ -26,23 +26,26 @@ function deleteCookie(name) { | ||
| } | ||
| head.headers.append("Set-Cookie", header); | ||
| return head.headers.append("Set-Cookie", header); | ||
| } | ||
| return { | ||
| ..._nullishCoalesce(context, () => ( {})), | ||
| get fami() { | ||
| return f; | ||
| }, | ||
| get cookies() { | ||
| const cookies = Object.freeze(f.parse(req.headers.get("Cookie"))); | ||
| Object.defineProperties(this, { | ||
| cookies: { | ||
| value: cookies, | ||
| enumerable: true, | ||
| configurable: true | ||
| } | ||
| }); | ||
| return cookies; | ||
| }, | ||
| setCookie, | ||
| deleteCookie | ||
| }; | ||
| function buildContext(input) { | ||
| return { | ||
| ..._nullishCoalesce(input, () => ( {})), | ||
| get fami() { | ||
| return f; | ||
| }, | ||
| get cookies() { | ||
| const cookies = Object.freeze(f.parse(req.headers.get("Cookie"))); | ||
| Object.defineProperties(this, { | ||
| cookies: { | ||
| value: cookies, | ||
| enumerable: true, | ||
| configurable: true | ||
| } | ||
| }); | ||
| return cookies; | ||
| }, | ||
| setCookie, | ||
| deleteCookie | ||
| }; | ||
| } | ||
| return buildContext(context); | ||
| }; | ||
@@ -49,0 +52,0 @@ } |
+4
-5
@@ -30,6 +30,5 @@ import { F as FamiInput, a as Fami, C as CookieValue, b as CookieAttributes, P as PromiseIfSecret } from './fami-CfMv7Vv1.cjs'; | ||
| } | ||
| interface FamiPipeContext<Names extends string, Defs extends FamiInput<Names>> { | ||
| <C, P>(context: NoOverlap<C, FamiContext<Names, Defs>> & C, params: P, req: KaitoRequestStub, head: KaitoHeadStub): C & FamiContext<Names, Defs>; | ||
| <C, P>(context: C extends null | undefined ? C : never, params: P, req: KaitoRequestStub, head: KaitoHeadStub): FamiContext<Names, Defs>; | ||
| } | ||
| type FamiPipeInput<C, Names extends string, Defs extends FamiInput<Names>> = C extends null | undefined ? C : NoOverlap<C, FamiContext<Names, Defs>> & C; | ||
| type FamiPipeOutput<C, Names extends string, Defs extends FamiInput<Names>> = C extends null | undefined ? FamiContext<Names, Defs> : C & FamiContext<Names, Defs>; | ||
| type FamiPipeContext<Names extends string, Defs extends FamiInput<Names>> = <C, P>(context: FamiPipeInput<C, Names, Defs>, params: P, req: KaitoRequestStub, head: KaitoHeadStub) => FamiPipeOutput<C, Names, Defs>; | ||
| /** | ||
@@ -64,2 +63,2 @@ * Creates a Kaito context wrapper that includes the Fami instance and cookie management methods. | ||
| export { type FamiContext, type FamiPipeContext, type KaitoHeadStub, type KaitoRequestStub, fami }; | ||
| export { type FamiContext, type FamiPipeContext, type FamiPipeInput, type FamiPipeOutput, type KaitoHeadStub, type KaitoRequestStub, fami }; |
+4
-5
@@ -30,6 +30,5 @@ import { F as FamiInput, a as Fami, C as CookieValue, b as CookieAttributes, P as PromiseIfSecret } from './fami-CfMv7Vv1.js'; | ||
| } | ||
| interface FamiPipeContext<Names extends string, Defs extends FamiInput<Names>> { | ||
| <C, P>(context: NoOverlap<C, FamiContext<Names, Defs>> & C, params: P, req: KaitoRequestStub, head: KaitoHeadStub): C & FamiContext<Names, Defs>; | ||
| <C, P>(context: C extends null | undefined ? C : never, params: P, req: KaitoRequestStub, head: KaitoHeadStub): FamiContext<Names, Defs>; | ||
| } | ||
| type FamiPipeInput<C, Names extends string, Defs extends FamiInput<Names>> = C extends null | undefined ? C : NoOverlap<C, FamiContext<Names, Defs>> & C; | ||
| type FamiPipeOutput<C, Names extends string, Defs extends FamiInput<Names>> = C extends null | undefined ? FamiContext<Names, Defs> : C & FamiContext<Names, Defs>; | ||
| type FamiPipeContext<Names extends string, Defs extends FamiInput<Names>> = <C, P>(context: FamiPipeInput<C, Names, Defs>, params: P, req: KaitoRequestStub, head: KaitoHeadStub) => FamiPipeOutput<C, Names, Defs>; | ||
| /** | ||
@@ -64,2 +63,2 @@ * Creates a Kaito context wrapper that includes the Fami instance and cookie management methods. | ||
| export { type FamiContext, type FamiPipeContext, type KaitoHeadStub, type KaitoRequestStub, fami }; | ||
| export { type FamiContext, type FamiPipeContext, type FamiPipeInput, type FamiPipeOutput, type KaitoHeadStub, type KaitoRequestStub, fami }; |
+24
-21
@@ -16,3 +16,3 @@ import { | ||
| } | ||
| head.headers.append("Set-Cookie", header); | ||
| return head.headers.append("Set-Cookie", header); | ||
| } | ||
@@ -26,23 +26,26 @@ function deleteCookie(name) { | ||
| } | ||
| head.headers.append("Set-Cookie", header); | ||
| return head.headers.append("Set-Cookie", header); | ||
| } | ||
| return { | ||
| ...context ?? {}, | ||
| get fami() { | ||
| return f; | ||
| }, | ||
| get cookies() { | ||
| const cookies = Object.freeze(f.parse(req.headers.get("Cookie"))); | ||
| Object.defineProperties(this, { | ||
| cookies: { | ||
| value: cookies, | ||
| enumerable: true, | ||
| configurable: true | ||
| } | ||
| }); | ||
| return cookies; | ||
| }, | ||
| setCookie, | ||
| deleteCookie | ||
| }; | ||
| function buildContext(input) { | ||
| return { | ||
| ...input ?? {}, | ||
| get fami() { | ||
| return f; | ||
| }, | ||
| get cookies() { | ||
| const cookies = Object.freeze(f.parse(req.headers.get("Cookie"))); | ||
| Object.defineProperties(this, { | ||
| cookies: { | ||
| value: cookies, | ||
| enumerable: true, | ||
| configurable: true | ||
| } | ||
| }); | ||
| return cookies; | ||
| }, | ||
| setCookie, | ||
| deleteCookie | ||
| }; | ||
| } | ||
| return buildContext(context); | ||
| }; | ||
@@ -49,0 +52,0 @@ } |
+1
-1
| { | ||
| "name": "fami", | ||
| "version": "2.0.3", | ||
| "version": "2.0.4", | ||
| "license": "MIT", | ||
@@ -5,0 +5,0 @@ "description": "Working with cookies shouldn't be complicated or scary.", |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
81468
0.8%1487
0.34%0
-100%