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

Function convertGroup

frontend/src/plugins/cel/logic/build.ts:105–128  ·  view source on GitHub ↗
(
    group: ConditionGroupExpr
  )

Source from the content-addressed store, hash-verified

103 throw new Error(`unsupported condition '${JSON.stringify(condition)}'`);
104 };
105 const convertGroup = async (
106 group: ConditionGroupExpr
107 ): Promise<CELExpr | undefined> => {
108 const { operator, args } = group;
109 if (args.length === 0) {
110 return undefined;
111 }
112 if (args.length === 1) {
113 // A dangled Logical Group should be extracted as single condition
114 return await convert(args[0]);
115 }
116 const [left, ...rest] = args;
117 return wrapCallExpr(
118 operator,
119 [
120 await convert(left),
121 await convertGroup({
122 type: ExprType.ConditionGroup,
123 operator,
124 args: rest,
125 }),
126 ].filter(Boolean) as CELExpr[]
127 );
128 };
129
130 seq.id = 1;
131 try {

Callers 1

convertFunction · 0.85

Calls 2

convertFunction · 0.85
wrapCallExprFunction · 0.85

Tested by

no test coverage detected