Skip to content

Commit fd98f34

Browse files
committed
Add Tuple type
1 parent f0fbaab commit fd98f34

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

extensions/ql-vscode/src/data-extensions-editor/predicates.ts

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,15 @@ export type ExternalApiUsageByType = {
1212

1313
export type ExtensiblePredicateDefinition = {
1414
extensiblePredicate: string;
15-
generateMethodDefinition: (method: ExternalApiUsageByType) => any[];
16-
readModeledMethod: (row: any[]) => ModeledMethodWithSignature;
15+
generateMethodDefinition: (method: ExternalApiUsageByType) => Tuple[];
16+
readModeledMethod: (row: Tuple[]) => ModeledMethodWithSignature;
1717

1818
supportedKinds?: string[];
1919
};
2020

21-
function readRowToMethod(row: any[]): string {
21+
type Tuple = boolean | number | string;
22+
23+
function readRowToMethod(row: Tuple[]): string {
2224
return `${row[0]}.${row[1]}#${row[3]}${row[4]}`;
2325
}
2426

@@ -48,8 +50,8 @@ export const extensiblePredicateDefinitions: Record<
4850
modeledMethod: {
4951
type: "source",
5052
input: "",
51-
output: row[6],
52-
kind: row[7],
53+
output: row[6] as string,
54+
kind: row[7] as string,
5355
},
5456
}),
5557
supportedKinds: ["remote"],
@@ -75,9 +77,9 @@ export const extensiblePredicateDefinitions: Record<
7577
signature: readRowToMethod(row),
7678
modeledMethod: {
7779
type: "sink",
78-
input: row[6],
80+
input: row[6] as string,
7981
output: "",
80-
kind: row[7],
82+
kind: row[7] as string,
8183
},
8284
}),
8385
supportedKinds: ["sql", "xss", "logging"],
@@ -104,9 +106,9 @@ export const extensiblePredicateDefinitions: Record<
104106
signature: readRowToMethod(row),
105107
modeledMethod: {
106108
type: "summary",
107-
input: row[6],
108-
output: row[7],
109-
kind: row[8],
109+
input: row[6] as string,
110+
output: row[7] as string,
111+
kind: row[8] as string,
110112
},
111113
}),
112114
supportedKinds: ["taint", "value"],

0 commit comments

Comments
 (0)