Home / File/ ExportSpecifier.js — svelte Source File

ExportSpecifier.js — svelte Source File

Architecture documentation for ExportSpecifier.js, a javascript file in the svelte codebase. 2 imports, 1 dependents.

File javascript Compiler Transformer 2 imports 1 dependents 1 functions

Entity Profile

Dependency Diagram

graph LR
  cc04e72a_ab02_4e20_9624_dc46c6f2aded["ExportSpecifier.js"]
  bf0d8f1b_17da_970d_bf44_fbcf099d5371["utils.js"]
  cc04e72a_ab02_4e20_9624_dc46c6f2aded --> bf0d8f1b_17da_970d_bf44_fbcf099d5371
  cc0c7132_9605_cd69_23b0_b710d67b19c8["validate_export"]
  cc04e72a_ab02_4e20_9624_dc46c6f2aded --> cc0c7132_9605_cd69_23b0_b710d67b19c8
  4aa8a188_84d4_0274_ed83_cac0ab1d3572["index.js"]
  4aa8a188_84d4_0274_ed83_cac0ab1d3572 --> cc04e72a_ab02_4e20_9624_dc46c6f2aded
  style cc04e72a_ab02_4e20_9624_dc46c6f2aded fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

/** @import { ExportSpecifier } from 'estree' */
/** @import { Context } from '../types' */
import { validate_export } from './shared/utils.js';

/**
 * @param {ExportSpecifier} node
 * @param {Context} context
 */
export function ExportSpecifier(node, context) {
	const local_name =
		node.local.type === 'Identifier' ? node.local.name : /** @type {string} */ (node.local.value);
	const exported_name =
		node.exported.type === 'Identifier'
			? node.exported.name
			: /** @type {string} */ (node.exported.value);

	if (context.state.ast_type === 'instance') {
		if (context.state.analysis.runes) {
			context.state.analysis.exports.push({
				name: local_name,
				alias: exported_name
			});

			const binding = context.state.scope.get(local_name);
			if (binding) binding.reassigned = true;
		}
	} else {
		validate_export(node, context.state.scope, local_name);
	}
}

Domain

Subdomains

Functions

Frequently Asked Questions

What does ExportSpecifier.js do?
ExportSpecifier.js is a source file in the svelte codebase, written in javascript. It belongs to the Compiler domain, Transformer subdomain.
What functions are defined in ExportSpecifier.js?
ExportSpecifier.js defines 1 function(s): ExportSpecifier.
What does ExportSpecifier.js depend on?
ExportSpecifier.js imports 2 module(s): utils.js, validate_export.
What files import ExportSpecifier.js?
ExportSpecifier.js is imported by 1 file(s): index.js.
Where is ExportSpecifier.js in the architecture?
ExportSpecifier.js is located at packages/svelte/src/compiler/phases/2-analyze/visitors/ExportSpecifier.js (domain: Compiler, subdomain: Transformer, directory: packages/svelte/src/compiler/phases/2-analyze/visitors).

Analyze Your Own Codebase

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

Try Supermodel Free