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

Function setup

test/performance.test.js:33–43  ·  view source on GitHub ↗
(conditions)

Source from the content-addressed store, hash-verified

31 }
32
33 function setup (conditions) {
34 const engine = engineFactory()
35 const config = deepClone({ conditions, event })
36 range(1000).forEach(() => {
37 const rule = factories.rule(config)
38 engine.addRule(rule)
39 })
40 engine.addFact('segment', 'european', { cache: true })
41 engine.addFact('age', 15, { cache: true })
42 return engine
43 }
44
45 it('performs "any" quickly', async () => {
46 const engine = setup(baseConditions)

Callers 1

Calls 3

rangeFunction · 0.85
addRuleMethod · 0.80
addFactMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…