File tree Expand file tree Collapse file tree 1 file changed +6
-15
lines changed Expand file tree Collapse file tree 1 file changed +6
-15
lines changed Original file line number Diff line number Diff line change @@ -11,19 +11,6 @@ const utils = require('../utils')
1111 * @type {{node: Expression, ref: string} }
1212 */
1313
14- /**
15- * @param declarator {VariableDeclarator}
16- * @returns {ScriptRef }
17- * */
18- function convertDeclaratorToScriptRef ( declarator ) {
19- return {
20- // @ts -ignore
21- node : declarator . init ,
22- // @ts -ignore
23- ref : declarator . id . name
24- }
25- }
26-
2714/**
2815 * @param body {(Statement | ModuleDeclaration)[]}
2916 * @returns {ScriptRef[] }
@@ -36,9 +23,13 @@ function getScriptRefsFromSetupFunction(body) {
3623 if (
3724 declarator . init ?. type === 'CallExpression' &&
3825 declarator . init . callee ?. type === 'Identifier' &&
39- [ 'ref' , 'shallowRef' ] . includes ( declarator . init ?. callee ?. name )
26+ declarator . id . type === 'Identifier' &&
27+ [ 'ref' , 'shallowRef' ] . includes ( declarator . init . callee . name )
4028 )
41- return [ convertDeclaratorToScriptRef ( declarator ) ]
29+ return {
30+ node : declarator . init ,
31+ ref : declarator . id . name
32+ }
4233 }
4334
4435 return [ ]
You can’t perform that action at this time.
0 commit comments