( celList: string[] )
| 22 | .replace(/\t/g, "\\t"); |
| 23 | |
| 24 | export const batchConvertCELStringToParsedExpr = async ( |
| 25 | celList: string[] |
| 26 | ): Promise<Expr[]> => { |
| 27 | try { |
| 28 | const request = create(BatchParseRequestSchema, { |
| 29 | expressions: celList, |
| 30 | }); |
| 31 | const response = await celServiceClientConnect.batchParse(request, { |
| 32 | contextValues: createContextValues().set(silentContextKey, true), |
| 33 | }); |
| 34 | |
| 35 | // Convert new Expr array to old Expr array for compatibility |
| 36 | return response.expressions; |
| 37 | } catch (error) { |
| 38 | console.error(error); |
| 39 | return Array.from({ length: celList.length }).map((_) => |
| 40 | create(ExprSchema, {}) |
| 41 | ); |
| 42 | } |
| 43 | }; |
| 44 | |
| 45 | export const batchConvertParsedExprToCELString = async ( |
| 46 | parsedExprList: Expr[] |
no test coverage detected