Home / Function/ validate_tag() — svelte Function Reference

validate_tag() — svelte Function Reference

Architecture documentation for the validate_tag() function in options.js from the svelte codebase.

Function javascript Compiler Transformer calls 2 called by 1

Entity Profile

Dependency Diagram

graph TD
  37835ed8_f4c9_aa55_0a7f_8f46a70c1ce3["validate_tag()"]
  09b07d2e_2631_ce6a_e899_0be23871c668["options.js"]
  37835ed8_f4c9_aa55_0a7f_8f46a70c1ce3 -->|defined in| 09b07d2e_2631_ce6a_e899_0be23871c668
  6a48e790_0ca5_6fae_197c_7c93c49d9b66["read_options()"]
  6a48e790_0ca5_6fae_197c_7c93c49d9b66 -->|calls| 37835ed8_f4c9_aa55_0a7f_8f46a70c1ce3
  ca12b88d_a584_9680_8db6_aee6eea15f82["svelte_options_invalid_tagname()"]
  37835ed8_f4c9_aa55_0a7f_8f46a70c1ce3 -->|calls| ca12b88d_a584_9680_8db6_aee6eea15f82
  35b51c2c_5948_a1b6_0b48_cd15ce3e5450["svelte_options_reserved_tagname()"]
  37835ed8_f4c9_aa55_0a7f_8f46a70c1ce3 -->|calls| 35b51c2c_5948_a1b6_0b48_cd15ce3e5450
  style 37835ed8_f4c9_aa55_0a7f_8f46a70c1ce3 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/svelte/src/compiler/phases/1-parse/read/options.js lines 252–263

function validate_tag(attribute, tag) {
	if (typeof tag !== 'string') {
		e.svelte_options_invalid_tagname(attribute);
	}
	if (tag) {
		if (!regex_valid_tag_name.test(tag)) {
			e.svelte_options_invalid_tagname(attribute);
		} else if (reserved_tag_names.includes(tag)) {
			e.svelte_options_reserved_tagname(attribute);
		}
	}
}

Domain

Subdomains

Called By

Frequently Asked Questions

What does validate_tag() do?
validate_tag() is a function in the svelte codebase, defined in packages/svelte/src/compiler/phases/1-parse/read/options.js.
Where is validate_tag() defined?
validate_tag() is defined in packages/svelte/src/compiler/phases/1-parse/read/options.js at line 252.
What does validate_tag() call?
validate_tag() calls 2 function(s): svelte_options_invalid_tagname, svelte_options_reserved_tagname.
What calls validate_tag()?
validate_tag() is called by 1 function(s): read_options.

Analyze Your Own Codebase

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

Try Supermodel Free