Home / Function/ check_hash() — svelte Function Reference

check_hash() — svelte Function Reference

Architecture documentation for the check_hash() function in html.js from the svelte codebase.

Entity Profile

Dependency Diagram

graph TD
  561f74af_4827_cde5_aa05_c2b8149b0a0f["check_hash()"]
  9c9641c6_8e9b_282d_184f_5515feedb7b5["html.js"]
  561f74af_4827_cde5_aa05_c2b8149b0a0f -->|defined in| 9c9641c6_8e9b_282d_184f_5515feedb7b5
  51425661_32dd_029c_f8aa_2371b127bd7f["html()"]
  51425661_32dd_029c_f8aa_2371b127bd7f -->|calls| 561f74af_4827_cde5_aa05_c2b8149b0a0f
  d203a90b_640a_13eb_ea6d_b1a9df120247["hash()"]
  561f74af_4827_cde5_aa05_c2b8149b0a0f -->|calls| d203a90b_640a_13eb_ea6d_b1a9df120247
  d18fdc96_52d4_5592_e1b0_bac74c7e8e80["hydration_html_changed()"]
  561f74af_4827_cde5_aa05_c2b8149b0a0f -->|calls| d18fdc96_52d4_5592_e1b0_bac74c7e8e80
  28c6afed_f4f8_7245_50fe_f12a7fd10cba["sanitize_location()"]
  561f74af_4827_cde5_aa05_c2b8149b0a0f -->|calls| 28c6afed_f4f8_7245_50fe_f12a7fd10cba
  style 561f74af_4827_cde5_aa05_c2b8149b0a0f fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/svelte/src/internal/client/dom/blocks/html.js lines 20–34

function check_hash(element, server_hash, value) {
	if (!server_hash || server_hash === hash(String(value ?? ''))) return;

	let location;

	// @ts-expect-error
	const loc = element.__svelte_meta?.loc;
	if (loc) {
		location = `near ${loc.file}:${loc.line}:${loc.column}`;
	} else if (dev_current_component_function?.[FILENAME]) {
		location = `in ${dev_current_component_function[FILENAME]}`;
	}

	w.hydration_html_changed(sanitize_location(location));
}

Domain

Subdomains

Called By

Frequently Asked Questions

What does check_hash() do?
check_hash() is a function in the svelte codebase, defined in packages/svelte/src/internal/client/dom/blocks/html.js.
Where is check_hash() defined?
check_hash() is defined in packages/svelte/src/internal/client/dom/blocks/html.js at line 20.
What does check_hash() call?
check_hash() calls 3 function(s): hash, hydration_html_changed, sanitize_location.
What calls check_hash()?
check_hash() is called by 1 function(s): html.

Analyze Your Own Codebase

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

Try Supermodel Free