MCPcopy Create free account
hub / github.com/microsoft/AI-Engineering-Coach / parseSingleCondition

Function parseSingleCondition

src/core/rule-parser.ts:232–243  ·  view source on GitHub ↗
(expr: string)

Source from the content-addressed store, hash-verified

230}
231
232function parseSingleCondition(expr: string): RuleCondition {
233 const match = expr.match(/^(\S+)\s*(<=|>=|!=|<|>|==|=|includes|not-includes|matches|not-matches)\s*(.+)$/);
234 if (!match) return { type: 'field-check', field: expr };
235
236 const [, field, rawOp, rawVal] = match;
237 return {
238 type: 'field-check',
239 field,
240 op: parseOp(rawOp),
241 value: parseValue(rawVal),
242 };
243}
244
245function parseOp(op: string): RuleCondition['op'] {
246 switch (op) {

Callers 2

parseFilterLineFunction · 0.85
parseCheckLineFunction · 0.85

Calls 2

parseOpFunction · 0.85
parseValueFunction · 0.85

Tested by

no test coverage detected