Home / Function/ trySerializeLocals() — astro Function Reference

trySerializeLocals() — astro Function Reference

Architecture documentation for the trySerializeLocals() function in index.ts from the astro codebase.

Entity Profile

Dependency Diagram

graph TD
  d47636bf_8980_a80c_556e_cdff726e0169["trySerializeLocals()"]
  539f677c_93c9_1e05_dcf8_dd470043a1a3["index.ts"]
  d47636bf_8980_a80c_556e_cdff726e0169 -->|defined in| 539f677c_93c9_1e05_dcf8_dd470043a1a3
  261d6ff8_70d7_3a97_9d59_8235fa39ade5["isLocalsSerializable()"]
  d47636bf_8980_a80c_556e_cdff726e0169 -->|calls| 261d6ff8_70d7_3a97_9d59_8235fa39ade5
  style d47636bf_8980_a80c_556e_cdff726e0169 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/astro/src/core/middleware/index.ts lines 189–195

function trySerializeLocals(value: unknown) {
	if (isLocalsSerializable(value)) {
		return JSON.stringify(value);
	} else {
		throw new Error("The passed value can't be serialized.");
	}
}

Domain

Subdomains

Frequently Asked Questions

What does trySerializeLocals() do?
trySerializeLocals() is a function in the astro codebase, defined in packages/astro/src/core/middleware/index.ts.
Where is trySerializeLocals() defined?
trySerializeLocals() is defined in packages/astro/src/core/middleware/index.ts at line 189.
What does trySerializeLocals() call?
trySerializeLocals() calls 1 function(s): isLocalsSerializable.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free