Home / Function/ add() — astro Function Reference

add() — astro Function Reference

Architecture documentation for the add() function in host-route.ts from the astro codebase.

Entity Profile

Dependency Diagram

graph TD
  b1f43f3f_9019_e0e4_9d66_75b560d13654["add()"]
  1c49873f_9e0f_a697_0d8d_933cddc2986d["HostRoutes"]
  b1f43f3f_9019_e0e4_9d66_75b560d13654 -->|defined in| 1c49873f_9e0f_a697_0d8d_933cddc2986d
  9ba1afb7_c929_0c88_8171_5062da01bcc4["binaryInsert()"]
  b1f43f3f_9019_e0e4_9d66_75b560d13654 -->|calls| 9ba1afb7_c929_0c88_8171_5062da01bcc4
  style b1f43f3f_9019_e0e4_9d66_75b560d13654 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/underscore-redirects/src/host-route.ts lines 26–43

	add(definition: HostRouteDefinition) {
		// Find the longest input, so we can format things nicely
		if (definition.input.length > this.minInputLength) {
			this.minInputLength = definition.input.length;
		}
		// Same for the target
		if (definition.target && definition.target.length > this.minTargetLength) {
			this.minTargetLength = definition.target.length;
		}

		binaryInsert(this.definitions, definition, (a, b) => {
			if (a.weight && b.weight) {
				return a.weight > b.weight;
			} else {
				return false;
			}
		});
	}

Domain

Subdomains

Frequently Asked Questions

What does add() do?
add() is a function in the astro codebase, defined in packages/underscore-redirects/src/host-route.ts.
Where is add() defined?
add() is defined in packages/underscore-redirects/src/host-route.ts at line 26.
What does add() call?
add() calls 1 function(s): binaryInsert.

Analyze Your Own Codebase

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

Try Supermodel Free