(source: Table | HashedTable, options: ITableExpressionOptions)
| 15 | export let foundIndex: number = 0; |
| 16 | |
| 17 | export 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 | } |
nothing calls this directly
no test coverage detected