MCPcopy
hub / github.com/vuejs/core / hasDefaultExport

Function hasDefaultExport

packages/compiler-sfc/src/rewriteDefault.ts:92–106  ·  view source on GitHub ↗
(ast: Statement[])

Source from the content-addressed store, hash-verified

90}
91
92export function hasDefaultExport(ast: Statement[]): boolean {
93 for (const stmt of ast) {
94 if (stmt.type === 'ExportDefaultDeclaration') {
95 return true
96 } else if (
97 stmt.type === 'ExportNamedDeclaration' &&
98 stmt.specifiers.some(
99 spec => (spec.exported as Identifier).name === 'default',
100 )
101 ) {
102 return true
103 }
104 }
105 return false
106}
107
108function specifierEnd(s: MagicString, end: number, nodeEnd: number | null) {
109 // export { default , foo } ...

Callers 1

rewriteDefaultASTFunction · 0.85

Calls 1

someMethod · 0.80

Tested by

no test coverage detected