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

Function getFactorName

frontend/src/plugins/cel/logic/resolve.ts:282–294  ·  view source on GitHub ↗
(expr: CELExpr)

Source from the content-addressed store, hash-verified

280};
281
282const getFactorName = (expr: CELExpr): string => {
283 if (expr.exprKind?.case === "identExpr") {
284 return expr.exprKind.value.name;
285 } else if (expr.exprKind?.case === "selectExpr") {
286 const selectExpr = expr.exprKind.value;
287 const operandName =
288 selectExpr.operand?.exprKind?.case === "identExpr"
289 ? selectExpr.operand.exprKind.value.name
290 : "";
291 return `${operandName}.${selectExpr.field}`;
292 }
293 throw new Error(`cannot resolve factor name ${JSON.stringify(expr)}`);
294};

Callers 4

resolveEqualityExprFunction · 0.85
resolveCompareExprFunction · 0.85
resolveStringExprFunction · 0.85
resolveCollectionExprFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected