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

Method calculate

src/fact.js:50–56  ·  view source on GitHub ↗

* Return the fact value, based on provided parameters * @param {object} params * @param {Almanac} almanac * @return {any} calculation method results

(params, almanac)

Source from the content-addressed store, hash-verified

48 * @return {any} calculation method results
49 */
50 calculate (params, almanac) {
51 // if constant fact w/set value, return immediately
52 if (Object.prototype.hasOwnProperty.call(this, 'value')) {
53 return this.value
54 }
55 return this.calculationMethod(params, almanac)
56 }
57
58 /**
59 * Return a cache key (MD5 string) based on parameters

Callers 2

fact.test.jsFile · 0.80
factValueMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected