extractEventNames() — vue Function Reference
Architecture documentation for the extractEventNames() function in compileScript.ts from the vue codebase.
Entity Profile
Dependency Diagram
graph TD ee433162_8cd6_89a6_0e46_2ee566037272["extractEventNames()"] c9346cac_54e3_f6ca_68a7_03c6e82c9609["compileScript.ts"] ee433162_8cd6_89a6_0e46_2ee566037272 -->|defined in| c9346cac_54e3_f6ca_68a7_03c6e82c9609 813ba817_060e_f16f_ab4c_2fd4225691a8["extractRuntimeEmits()"] 813ba817_060e_f16f_ab4c_2fd4225691a8 -->|calls| ee433162_8cd6_89a6_0e46_2ee566037272 style ee433162_8cd6_89a6_0e46_2ee566037272 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
packages/compiler-sfc/src/compileScript.ts lines 1577–1606
function extractEventNames(
eventName: ArrayPattern | Identifier | ObjectPattern | RestElement,
emits: Set<string>
) {
if (
eventName.type === 'Identifier' &&
eventName.typeAnnotation &&
eventName.typeAnnotation.type === 'TSTypeAnnotation'
) {
const typeNode = eventName.typeAnnotation.typeAnnotation
if (typeNode.type === 'TSLiteralType') {
if (
typeNode.literal.type !== 'UnaryExpression' &&
typeNode.literal.type !== 'TemplateLiteral'
) {
emits.add(String(typeNode.literal.value))
}
} else if (typeNode.type === 'TSUnionType') {
for (const t of typeNode.types) {
if (
t.type === 'TSLiteralType' &&
t.literal.type !== 'UnaryExpression' &&
t.literal.type !== 'TemplateLiteral'
) {
emits.add(String(t.literal.value))
}
}
}
}
}
Domain
Subdomains
Defined In
Called By
Source
Frequently Asked Questions
What does extractEventNames() do?
extractEventNames() is a function in the vue codebase, defined in packages/compiler-sfc/src/compileScript.ts.
Where is extractEventNames() defined?
extractEventNames() is defined in packages/compiler-sfc/src/compileScript.ts at line 1577.
What calls extractEventNames()?
extractEventNames() is called by 1 function(s): extractRuntimeEmits.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free