Home / Function/ third() — astro Function Reference

third() — astro Function Reference

Architecture documentation for the third() function in middleware.js from the astro codebase.

Entity Profile

Dependency Diagram

graph TD
  04737df3_31d0_3131_f9ae_1e66f3aaf95e["third()"]
  78d5cc03_20df_63a2_afe4_c263dd05734a["middleware.js"]
  04737df3_31d0_3131_f9ae_1e66f3aaf95e -->|defined in| 78d5cc03_20df_63a2_afe4_c263dd05734a
  style 04737df3_31d0_3131_f9ae_1e66f3aaf95e fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/astro/test/fixtures/middleware space/src/middleware.js lines 76–85

const third = defineMiddleware(async (context, next) => {
	if (context.request.url.includes('/broken-locals')) {
		Object.assign(context.locals, {
			fn() {},
		});
	} else if (context.request.url.includes('/does-nothing')) {
		return undefined;
	}
	return next();
});

Subdomains

Frequently Asked Questions

What does third() do?
third() is a function in the astro codebase, defined in packages/astro/test/fixtures/middleware space/src/middleware.js.
Where is third() defined?
third() is defined in packages/astro/test/fixtures/middleware space/src/middleware.js at line 76.

Analyze Your Own Codebase

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

Try Supermodel Free