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

Function get_rune

packages/svelte/src/compiler/phases/scope.js:1433–1441  ·  view source on GitHub ↗
(node, scope)

Source from the content-addressed store, hash-verified

1431 * @param {Scope} scope
1432 */
1433export function get_rune(node, scope) {
1434 if (!node) return null;
1435 if (node.type !== 'CallExpression') return null;
1436
1437 const keypath = get_global_keypath(node.callee, scope);
1438
1439 if (!keypath || !is_rune(keypath)) return null;
1440 return keypath;
1441}
1442
1443/**
1444 * Returns the name of the rune if the given expression is a `CallExpression` using a rune.

Callers 15

VariableDeclarationFunction · 0.90
build_assignmentFunction · 0.90
CallExpressionFunction · 0.90
ExpressionStatementFunction · 0.90
VariableDeclarationFunction · 0.90
build_assignmentFunction · 0.90
CallExpressionFunction · 0.90
PropertyDefinitionFunction · 0.90
ExpressionStatementFunction · 0.90
VariableDeclarationFunction · 0.90
AssignmentPatternFunction · 0.90
analyze_componentFunction · 0.90

Calls 2

is_runeFunction · 0.90
get_global_keypathFunction · 0.85

Tested by

no test coverage detected