response.ts — astro Source File
Architecture documentation for response.ts, a typescript file in the astro codebase. 1 imports, 0 dependents.
Entity Profile
Dependency Diagram
graph LR 3653cb97_bec2_605a_a150_36f4fb60e6f3["response.ts"] 5799bf2d_d18e_6c2e_364a_a825ef7f6e79["../../core/cookies/cookies.js"] 3653cb97_bec2_605a_a150_36f4fb60e6f3 --> 5799bf2d_d18e_6c2e_364a_a825ef7f6e79 style 3653cb97_bec2_605a_a150_36f4fb60e6f3 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
import { AstroCookies } from './cookies.js';
const astroCookiesSymbol = Symbol.for('astro.cookies');
export function attachCookiesToResponse(response: Response, cookies: AstroCookies) {
Reflect.set(response, astroCookiesSymbol, cookies);
}
export function getCookiesFromResponse(response: Response): AstroCookies | undefined {
let cookies = Reflect.get(response, astroCookiesSymbol);
if (cookies != null) {
return cookies as AstroCookies;
} else {
return undefined;
}
}
export function* getSetCookiesFromResponse(response: Response): Generator<string, string[]> {
const cookies = getCookiesFromResponse(response);
if (!cookies) {
return [];
}
for (const headerValue of AstroCookies.consume(cookies)) {
yield headerValue;
}
return [];
}
Domain
Subdomains
Dependencies
- ../../core/cookies/cookies.js
Source
Frequently Asked Questions
What does response.ts do?
response.ts is a source file in the astro codebase, written in typescript. It belongs to the CoreAstro domain, RenderingEngine subdomain.
What functions are defined in response.ts?
response.ts defines 3 function(s): attachCookiesToResponse, getCookiesFromResponse, getSetCookiesFromResponse.
What does response.ts depend on?
response.ts imports 1 module(s): ../../core/cookies/cookies.js.
Where is response.ts in the architecture?
response.ts is located at packages/astro/src/core/cookies/response.ts (domain: CoreAstro, subdomain: RenderingEngine, directory: packages/astro/src/core/cookies).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free