MCPcopy Create free account
hub / github.com/bytebase/bytebase / batchConvertFromCELString

Function batchConvertFromCELString

frontend/src/utils/issue/cel.ts:369–382  ·  view source on GitHub ↗
(
  cels: string[]
)

Source from the content-addressed store, hash-verified

367};
368
369export 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
384export const convertFromExpr = (expr: Expr): ConditionExpression => {
385 const simpleExpr = resolveCELExpr(expr);

Callers 1

useExemptionDataReactFunction · 0.90

Calls 2

convertFromExprFunction · 0.85

Tested by

no test coverage detected