context.ts — astro Source File
Architecture documentation for context.ts, a typescript file in the astro codebase. 1 imports, 0 dependents.
Entity Profile
Dependency Diagram
graph LR 47e7ffde_569f_8a55_f3e4_43ad1c18f309["context.ts"] c8c6207d_9d3f_cccc_cc72_d913b624305f["./types.js"] 47e7ffde_569f_8a55_f3e4_43ad1c18f309 --> c8c6207d_9d3f_cccc_cc72_d913b624305f style 47e7ffde_569f_8a55_f3e4_43ad1c18f309 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
import type { RendererContext } from './types.js';
type Context = {
id: string;
c: number;
};
const contexts = new WeakMap<RendererContext['result'], Context>();
export function getContext(result: RendererContext['result']): Context {
if (contexts.has(result)) {
return contexts.get(result)!;
}
let ctx: Context = {
c: 0,
get id() {
return 's' + this.c.toString();
},
};
contexts.set(result, ctx);
return ctx;
}
export function incrementId(ctx: Context): string {
let id = ctx.id;
ctx.c++;
return id;
}
Domain
Subdomains
Functions
Types
Dependencies
- ./types.js
Source
Frequently Asked Questions
What does context.ts do?
context.ts is a source file in the astro codebase, written in typescript. It belongs to the CoreAstro domain, CoreMiddleware subdomain.
What functions are defined in context.ts?
context.ts defines 2 function(s): getContext, incrementId.
What does context.ts depend on?
context.ts imports 1 module(s): ./types.js.
Where is context.ts in the architecture?
context.ts is located at packages/integrations/solid/src/context.ts (domain: CoreAstro, subdomain: CoreMiddleware, directory: packages/integrations/solid/src).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free