Skip to content

Commit c6a9f23

Browse files
Delete convertToLegacyModeledMethods
1 parent d531bc6 commit c6a9f23

File tree

1 file changed

+0
-27
lines changed

1 file changed

+0
-27
lines changed

extensions/ql-vscode/src/model-editor/shared/modeled-methods-legacy.ts

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,5 @@
11
import { ModeledMethod } from "../modeled-method";
22

3-
/**
4-
* Converts a record of a single ModeledMethod indexed by signature to a record of ModeledMethod[] indexed by signature
5-
* for legacy usage. This function should always be used instead of the trivial conversion to track usages of this
6-
* conversion.
7-
*
8-
* This method should only be called inside a `postMessage` call. If it's used anywhere else, consider whether the
9-
* boundary is correct: the boundary should as close as possible to the extension host -> webview boundary.
10-
*
11-
* @param modeledMethods The record of a single ModeledMethod indexed by signature
12-
*/
13-
export function convertToLegacyModeledMethods(
14-
modeledMethods: Record<string, ModeledMethod[]>,
15-
): Record<string, ModeledMethod> {
16-
// Always take the first modeled method in the array
17-
return Object.fromEntries(
18-
Object.entries(modeledMethods)
19-
.map(([signature, modeledMethods]) => {
20-
const modeledMethod = convertToLegacyModeledMethod(modeledMethods);
21-
if (!modeledMethod) {
22-
return null;
23-
}
24-
return [signature, modeledMethod];
25-
})
26-
.filter((entry): entry is [string, ModeledMethod] => entry !== null),
27-
);
28-
}
29-
303
/**
314
* Converts a single ModeledMethod to a ModeledMethod[] for legacy usage. This function should always be used instead
325
* of the trivial conversion to track usages of this conversion.

0 commit comments

Comments
 (0)