Home / Function/ set_title() — svelte Function Reference

set_title() — svelte Function Reference

Architecture documentation for the set_title() function in renderer.js from the svelte codebase.

Entity Profile

Dependency Diagram

graph TD
  658aea3c_3677_5e23_97a5_866bbdc9fd99["set_title()"]
  27e4b187_7d63_5de0_1c16_1569e67253dd["SSRState"]
  658aea3c_3677_5e23_97a5_866bbdc9fd99 -->|defined in| 27e4b187_7d63_5de0_1c16_1569e67253dd
  ba594e9e_df42_b3bb_2cd9_f91387ffad49["title()"]
  ba594e9e_df42_b3bb_2cd9_f91387ffad49 -->|calls| 658aea3c_3677_5e23_97a5_866bbdc9fd99
  style 658aea3c_3677_5e23_97a5_866bbdc9fd99 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/svelte/src/internal/server/renderer.js lines 762–780

	set_title(value, path) {
		const current = this.#title.path;

		let i = 0;
		let l = Math.min(path.length, current.length);

		// skip identical prefixes - [1, 2, 3, ...] === [1, 2, 3, ...]
		while (i < l && path[i] === current[i]) i += 1;

		if (path[i] === undefined) return;

		// replace title if
		// - incoming path is longer - [7, 8, 9] > [7, 8]
		// - incoming path is later  - [7, 8, 9] > [7, 8, 8]
		if (current[i] === undefined || path[i] > current[i]) {
			this.#title.path = path;
			this.#title.value = value;
		}
	}

Domain

Subdomains

Called By

Frequently Asked Questions

What does set_title() do?
set_title() is a function in the svelte codebase, defined in packages/svelte/src/internal/server/renderer.js.
Where is set_title() defined?
set_title() is defined in packages/svelte/src/internal/server/renderer.js at line 762.
What calls set_title()?
set_title() is called by 1 function(s): title.

Analyze Your Own Codebase

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

Try Supermodel Free