Home / Function/ match() — svelte Function Reference

match() — svelte Function Reference

Architecture documentation for the match() function in index.js from the svelte codebase.

Entity Profile

Dependency Diagram

graph TD
  3aaad8d7_559e_ad7a_ac1b_00e2da95ac42["match()"]
  b4b7c38b_c055_e5c3_8980_e4dacbebb18a["Parser"]
  3aaad8d7_559e_ad7a_ac1b_00e2da95ac42 -->|defined in| b4b7c38b_c055_e5c3_8980_e4dacbebb18a
  6803b125_77b2_093b_9bc0_89ba97ab12e4["eat()"]
  6803b125_77b2_093b_9bc0_89ba97ab12e4 -->|calls| 3aaad8d7_559e_ad7a_ac1b_00e2da95ac42
  style 3aaad8d7_559e_ad7a_ac1b_00e2da95ac42 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/svelte/src/compiler/phases/1-parse/index.js lines 187–195

	match(str) {
		const length = str.length;
		if (length === 1) {
			// more performant than slicing
			return this.template[this.index] === str;
		}

		return this.template.slice(this.index, this.index + length) === str;
	}

Domain

Subdomains

Called By

Frequently Asked Questions

What does match() do?
match() is a function in the svelte codebase, defined in packages/svelte/src/compiler/phases/1-parse/index.js.
Where is match() defined?
match() is defined in packages/svelte/src/compiler/phases/1-parse/index.js at line 187.
What calls match()?
match() is called by 1 function(s): eat.

Analyze Your Own Codebase

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

Try Supermodel Free