MCPcopy Create free account
hub / github.com/abaplint/transpiler / tableExpression

Function tableExpression

packages/runtime/src/operators/table_expression.ts:17–35  ·  view source on GitHub ↗
(source: Table | HashedTable, options: ITableExpressionOptions)

Source from the content-addressed store, hash-verified

15export let foundIndex: number = 0;
16
17export async function tableExpression(source: Table | HashedTable, options: ITableExpressionOptions) {
18 let found;
19 if (options.index) {
20 foundIndex = parse(options.index) - 1;
21 found = source.array()[ foundIndex ];
22 } else if (options.withKey) {
23 const search = await searchWithKeyPromise(source.array(), options.withKey, 0, options?.usesTableLine);
24 found = search.found;
25 foundIndex = search.foundIndex;
26 } else {
27 throw new Error("TableExpression runtime: todo");
28 }
29
30 if (found === undefined) {
31 throwError("CX_SY_ITAB_LINE_NOT_FOUND");
32 }
33
34 return found;
35}

Callers

nothing calls this directly

Calls 4

parseFunction · 0.90
searchWithKeyPromiseFunction · 0.90
throwErrorFunction · 0.90
arrayMethod · 0.45

Tested by

no test coverage detected