MCPcopy Index your code
hub / github.com/apache/echarts / parseAndOrOption

Function parseAndOrOption

src/util/conditionalExpression.ts:334–359  ·  view source on GitHub ↗
(
    op: 'and' | 'or',
    exprOption: LogicalExpressionOption,
    getters: ConditionalGetters
)

Source from the content-addressed store, hash-verified

332}
333
334function parseAndOrOption(
335 op: 'and' | 'or',
336 exprOption: LogicalExpressionOption,
337 getters: ConditionalGetters
338): ParsedConditionInternal {
339 const subOptionArr = exprOption[op] as ConditionalExpressionOption[];
340 let errMsg = '';
341 if (__DEV__) {
342 errMsg = makePrintable(
343 '"and"/"or" condition should only be `' + op + ': [...]` and must not be empty array.',
344 'Illegal condition:', exprOption
345 );
346 }
347 if (!isArray(subOptionArr)) {
348 throwError(errMsg);
349 }
350 if (!(subOptionArr as []).length) {
351 throwError(errMsg);
352 }
353 const cond = op === 'and' ? new AndConditionInternal() : new OrConditionInternal();
354 cond.children = map(subOptionArr, subOption => parseOption(subOption, getters));
355 if (!cond.children.length) {
356 throwError(errMsg);
357 }
358 return cond;
359}
360
361function parseNotOption(
362 exprOption: LogicalExpressionOption,

Callers 1

parseOptionFunction · 0.85

Calls 4

makePrintableFunction · 0.90
throwErrorFunction · 0.90
isArrayFunction · 0.85
parseOptionFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…