is_safe_identifier() — svelte Function Reference
Architecture documentation for the is_safe_identifier() function in utils.js from the svelte codebase.
Entity Profile
Dependency Diagram
graph TD e40e188e_6def_6359_11b9_9532abe99b8d["is_safe_identifier()"] bf0d8f1b_17da_970d_bf44_fbcf099d5371["utils.js"] e40e188e_6def_6359_11b9_9532abe99b8d -->|defined in| bf0d8f1b_17da_970d_bf44_fbcf099d5371 f847bd70_7e16_ed37_5fde_c34cd0ce1d43["CallExpression()"] f847bd70_7e16_ed37_5fde_c34cd0ce1d43 -->|calls| e40e188e_6def_6359_11b9_9532abe99b8d 4123505d_2086_d0a0_2e0e_a28cc51de65e["MemberExpression()"] 4123505d_2086_d0a0_2e0e_a28cc51de65e -->|calls| e40e188e_6def_6359_11b9_9532abe99b8d 627dc2f8_4dbc_5bb1_8f54_cee503e17098["get()"] e40e188e_6def_6359_11b9_9532abe99b8d -->|calls| 627dc2f8_4dbc_5bb1_8f54_cee503e17098 style e40e188e_6def_6359_11b9_9532abe99b8d fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
packages/svelte/src/compiler/phases/2-analyze/visitors/shared/utils.js lines 176–195
export function is_safe_identifier(expression, scope) {
let node = expression;
while (node.type === 'MemberExpression') node = node.object;
if (node.type !== 'Identifier') return false;
const binding = scope.get(node.name);
if (!binding) return true;
if (binding.kind === 'store_sub') {
return is_safe_identifier({ name: node.name.slice(1), type: 'Identifier' }, scope);
}
return (
binding.declaration_kind !== 'import' &&
binding.kind !== 'prop' &&
binding.kind !== 'bindable_prop' &&
binding.kind !== 'rest_prop'
);
}
Domain
Subdomains
Calls
Called By
Source
Frequently Asked Questions
What does is_safe_identifier() do?
is_safe_identifier() is a function in the svelte codebase, defined in packages/svelte/src/compiler/phases/2-analyze/visitors/shared/utils.js.
Where is is_safe_identifier() defined?
is_safe_identifier() is defined in packages/svelte/src/compiler/phases/2-analyze/visitors/shared/utils.js at line 176.
What does is_safe_identifier() call?
is_safe_identifier() calls 1 function(s): get.
What calls is_safe_identifier()?
is_safe_identifier() is called by 2 function(s): CallExpression, MemberExpression.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free