Home / Function/ migrate_svelte_ignore() — svelte Function Reference

migrate_svelte_ignore() — svelte Function Reference

Architecture documentation for the migrate_svelte_ignore() function in extract_svelte_ignore.js from the svelte codebase.

Entity Profile

Dependency Diagram

graph TD
  43b7cf26_5d9e_499a_65e2_e2bd5436b694["migrate_svelte_ignore()"]
  d1869e84_a713_3c60_3aae_40e1a6b78424["extract_svelte_ignore.js"]
  43b7cf26_5d9e_499a_65e2_e2bd5436b694 -->|defined in| d1869e84_a713_3c60_3aae_40e1a6b78424
  5526816f_479b_70ec_8d5c_4877691ffc8f["template.Comment()"]
  5526816f_479b_70ec_8d5c_4877691ffc8f -->|calls| 43b7cf26_5d9e_499a_65e2_e2bd5436b694
  style 43b7cf26_5d9e_499a_65e2_e2bd5436b694 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/svelte/src/compiler/utils/extract_svelte_ignore.js lines 89–104

export function migrate_svelte_ignore(text) {
	const match = regex_svelte_ignore.exec(text);
	if (!match) return text;

	const length = match[0].length;
	return (
		text.substring(0, length) +
		text.substring(length).replace(/\w+-\w+(-\w+)*/g, (code, _, idx) => {
			let replacement = replacements[code] ?? code.replace(/-/g, '_');
			if (/\w+-\w+/.test(text.substring(length + idx + code.length))) {
				replacement += ',';
			}
			return replacement;
		})
	);
}

Domain

Subdomains

Called By

Frequently Asked Questions

What does migrate_svelte_ignore() do?
migrate_svelte_ignore() is a function in the svelte codebase, defined in packages/svelte/src/compiler/utils/extract_svelte_ignore.js.
Where is migrate_svelte_ignore() defined?
migrate_svelte_ignore() is defined in packages/svelte/src/compiler/utils/extract_svelte_ignore.js at line 89.
What calls migrate_svelte_ignore()?
migrate_svelte_ignore() is called by 1 function(s): template.Comment.

Analyze Your Own Codebase

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

Try Supermodel Free