Remove undefined from readModeledMethod return type

This commit is contained in:
Koen Vlaswinkel
2023-04-06 16:27:34 +02:00
parent 3214a376ad
commit 0d00e5c5b7
2 changed files with 5 additions and 9 deletions

View File

@@ -72,15 +72,11 @@ class FlowModelGenerator {
const results = decodedResults.tuples;
return results
.map((result): [string, ModeledMethod] | undefined => {
const row = result[0] as string;
return results.map((result): [string, ModeledMethod] => {
const row = result[0] as string;
return definition.readModeledMethod(row.split(";"));
})
.filter(
(result): result is [string, ModeledMethod] => result !== undefined,
);
return definition.readModeledMethod(row.split(";"));
});
}
async run(

View File

@@ -9,7 +9,7 @@ type ExternalApiUsageByType = {
type ExtensiblePredicateDefinition = {
extensiblePredicate: string;
generateMethodDefinition: (method: ExternalApiUsageByType) => any[];
readModeledMethod: (row: any[]) => [string, ModeledMethod] | undefined;
readModeledMethod: (row: any[]) => [string, ModeledMethod];
};
function readRowToMethod(row: any[]): string {