MCPcopy
hub / github.com/sveltejs/svelte / find_closing_parenthesis

Function find_closing_parenthesis

packages/svelte/src/compiler/migrate/index.js:102–114  ·  view source on GitHub ↗

* @param {number} start * @param {string} code

(start, code)

Source from the content-addressed store, hash-verified

100 * @param {string} code
101 */
102function find_closing_parenthesis(start, code) {
103 let parenthesis = 1;
104 let end = start;
105 let char = code[end];
106 // find the closing parenthesis
107 while (parenthesis !== 0 && char) {
108 if (char === '(') parenthesis++;
109 if (char === ')') parenthesis--;
110 end++;
111 char = code[end];
112 }
113 return end;
114}
115
116/**
117 * Does a best-effort migration of Svelte code towards using runes, event attributes and render tags.

Callers 1

migrate_cssFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected