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

Method toJSON

src/rule.js:150–161  ·  view source on GitHub ↗
(stringify = true)

Source from the content-addressed store, hash-verified

148 }
149
150 toJSON (stringify = true) {
151 const props = {
152 conditions: this.conditions.toJSON(false),
153 priority: this.priority,
154 event: this.ruleEvent,
155 name: this.name
156 }
157 if (stringify) {
158 return JSON.stringify(props)
159 }
160 return props
161 }
162
163 /**
164 * Priorizes an array of conditions based on "priority"

Callers 3

index.test-d.tsFile · 0.45
condition.test.jsFile · 0.45
rule.test.jsFile · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected