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

Function parseOption

src/util/conditionalExpression.ts:301–332  ·  view source on GitHub ↗
(
    exprOption: ConditionalExpressionOption,
    getters: ConditionalGetters
)

Source from the content-addressed store, hash-verified

299}
300
301function parseOption(
302 exprOption: ConditionalExpressionOption,
303 getters: ConditionalGetters
304): ParsedConditionInternal {
305 if (exprOption === true || exprOption === false) {
306 const cond = new ConstConditionInternal();
307 cond.value = exprOption as boolean;
308 return cond;
309 }
310
311 let errMsg = '';
312 if (!isObjectNotArray(exprOption)) {
313 if (__DEV__) {
314 errMsg = makePrintable(
315 'Illegal config. Expect a plain object but actually', exprOption
316 );
317 }
318 throwError(errMsg);
319 }
320
321 if ((exprOption as LogicalExpressionOption).and) {
322 return parseAndOrOption('and', exprOption as LogicalExpressionOption, getters);
323 }
324 else if ((exprOption as LogicalExpressionOption).or) {
325 return parseAndOrOption('or', exprOption as LogicalExpressionOption, getters);
326 }
327 else if ((exprOption as LogicalExpressionOption).not) {
328 return parseNotOption(exprOption as LogicalExpressionOption, getters);
329 }
330
331 return parseRelationalOption(exprOption as RelationalExpressionOption, getters);
332}
333
334function parseAndOrOption(
335 op: 'and' | 'or',

Callers 3

parseAndOrOptionFunction · 0.85
parseNotOptionFunction · 0.85
constructorMethod · 0.85

Calls 6

makePrintableFunction · 0.90
throwErrorFunction · 0.90
isObjectNotArrayFunction · 0.85
parseAndOrOptionFunction · 0.85
parseNotOptionFunction · 0.85
parseRelationalOptionFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…