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

Function processDeclaration

rollup.dts.config.js:70–85  ·  view source on GitHub ↗

* @param {import('@babel/types').VariableDeclarator | import('@babel/types').TSTypeAliasDeclaration | import('@babel/types').TSInterfaceDeclaration | import('@babel/types').TSDeclareFunction | import('@babel/types').TSInterfaceDeclaration | import('@babel/types').TSEnumDeclaration | import('@babel/t

(node, parentDecl)

Source from the content-addressed store, hash-verified

68 * @param {import('@babel/types').VariableDeclaration} [parentDecl]
69 */
70 function processDeclaration(node, parentDecl) {
71 if (!node.id) {
72 return
73 }
74 assert(node.id.type === 'Identifier')
75 const name = node.id.name
76 if (name.startsWith('_')) {
77 return
78 }
79 shouldRemoveExport.add(name)
80 if (isExported.has(name)) {
81 const start = (parentDecl || node).start
82 assert(typeof start === 'number')
83 s.prependLeft(start, `export `)
84 }
85 }
86
87 const isExported = new Set()
88 const shouldRemoveExport = new Set()

Callers 1

renderChunkFunction · 0.85

Calls 2

hasMethod · 0.80
assertFunction · 0.50

Tested by

no test coverage detected