Skip to content

Commit f0fd8a6

Browse files
committed
lint
1 parent ef52e58 commit f0fd8a6

File tree

1 file changed

+2
-18
lines changed
  • packages/mongodb-ts-autocomplete/src/cdt-analyser

1 file changed

+2
-18
lines changed

packages/mongodb-ts-autocomplete/src/cdt-analyser/index.ts

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -38,22 +38,6 @@ function evaluateNode(node: ts.Node): any {
3838
return null;
3939
}
4040

41-
function findMethodCallNodeAtPosition(
42-
node: ts.Node,
43-
caret: number
44-
): ts.CallExpression | undefined {
45-
if (ts.isCallExpression(node)) {
46-
const methodName = node.expression;
47-
if (ts.isPropertyAccessExpression(methodName) && node.getEnd() >= caret) {
48-
return node;
49-
}
50-
}
51-
52-
return node.forEachChild((child) =>
53-
findMethodCallNodeAtPosition(child, caret)
54-
);
55-
}
56-
5741
const QUERY_METHODS = ['aggregate', 'find', 'findOne'];
5842

5943
export function inferCollectionNameFromFunctionCall(
@@ -126,7 +110,7 @@ export function extractPipelineUptoCaret(
126110

127111
function findArrayLiteralExpression(
128112
node: ts.Node,
129-
inArray: boolean = false
113+
inArray = false
130114
): ts.ArrayLiteralExpression | undefined {
131115
if (ts.isArrayLiteralExpression(node) && inArray) {
132116
return node;
@@ -156,7 +140,7 @@ export function extractPipelineUptoCaret(
156140
return elementsBeforeCaret;
157141
}
158142

159-
return null;
143+
return [];
160144
}
161145

162146
export function extractPipelineFromLastAggregate(

0 commit comments

Comments
 (0)