MCPcopy
hub / github.com/CacheControl/json-rules-engine / evaluateConditions

Method evaluateConditions

src/rule.js:246–255  ·  view source on GitHub ↗
(conditions, method)

Source from the content-addressed store, hash-verified

244 * @return {Promise(boolean)} whether conditions evaluated truthy or falsey based on condition evaluation + method
245 */
246 const evaluateConditions = (conditions, method) => {
247 if (!Array.isArray(conditions)) conditions = [conditions]
248
249 return Promise.all(
250 conditions.map((condition) => evaluateCondition(condition))
251 ).then((conditionResults) => {
252 debug('rule::evaluateConditions results', conditionResults)
253 return method.call(conditionResults, (result) => result === true)
254 })
255 }
256
257 /**
258 * Evaluates a set of conditions based on an 'all', 'any', or 'not' operator.

Callers

nothing calls this directly

Calls 2

debugFunction · 0.85
allMethod · 0.80

Tested by

no test coverage detected