( cels: string[] )
| 367 | }; |
| 368 | |
| 369 | export const batchConvertFromCELString = async ( |
| 370 | cels: string[] |
| 371 | ): Promise<ConditionExpression[]> => { |
| 372 | const celExprs = await batchConvertCELStringToParsedExpr(cels); |
| 373 | const resp: ConditionExpression[] = []; |
| 374 | for (let i = 0; i < celExprs.length; i++) { |
| 375 | if (cels[i] === "true" || !celExprs[i]) { |
| 376 | resp.push({}); |
| 377 | } else { |
| 378 | resp.push(convertFromExpr(celExprs[i])); |
| 379 | } |
| 380 | } |
| 381 | return resp; |
| 382 | }; |
| 383 | |
| 384 | export const convertFromExpr = (expr: Expr): ConditionExpression => { |
| 385 | const simpleExpr = resolveCELExpr(expr); |
no test coverage detected