MCPcopy
hub / github.com/tdewolff/minify / parseAndOrOption

Function parseAndOrOption

_benchmarks/sample_echarts.js:90939–90965  ·  view source on GitHub ↗
(op, exprOption, getters)

Source from the content-addressed store, hash-verified

90937 }
90938
90939 function parseAndOrOption(op, exprOption, getters) {
90940 var subOptionArr = exprOption[op];
90941 var errMsg = '';
90942
90943 if ("development" !== 'production') {
90944 errMsg = makePrintable('"and"/"or" condition should only be `' + op + ': [...]` and must not be empty array.', 'Illegal condition:', exprOption);
90945 }
90946
90947 if (!isArray(subOptionArr)) {
90948 throwError(errMsg);
90949 }
90950
90951 if (!subOptionArr.length) {
90952 throwError(errMsg);
90953 }
90954
90955 var cond = op === 'and' ? new AndConditionInternal() : new OrConditionInternal();
90956 cond.children = map(subOptionArr, function (subOption) {
90957 return parseOption(subOption, getters);
90958 });
90959
90960 if (!cond.children.length) {
90961 throwError(errMsg);
90962 }
90963
90964 return cond;
90965 }
90966
90967 function parseNotOption(exprOption, getters) {
90968 var subOption = exprOption.not;

Callers 1

parseOptionFunction · 0.85

Calls 5

makePrintableFunction · 0.85
throwErrorFunction · 0.85
parseOptionFunction · 0.85
isArrayFunction · 0.70
mapFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…