Skip to content

Commit 0ca291a

Browse files
committed
Updating documentation
1 parent ab42f48 commit 0ca291a

File tree

1 file changed

+8
-13
lines changed

1 file changed

+8
-13
lines changed

README.md

+8-13
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
# json-rules-engine-simplified
22
A simple rules engine expressed in JSON
33

4-
The primary goal of this project was to be used
5-
as alternative to [json-rules-engine](https://github.com/CacheControl/json-rules-engine) in [react-jsonschema-form-conditionals](https://github.com/RxNT/react-jsonschema-form-conditionals),
6-
as such it has some functionality, that might be specific, but there is nothing preventing it from more generic use.
4+
The primary goal of this project is to be
5+
an alternative of [json-rules-engine](https://github.com/CacheControl/json-rules-engine) for [react-jsonschema-form-conditionals](https://github.com/RxNT/react-jsonschema-form-conditionals),
6+
as such it has similar interface and configuration, but simplified predicate language, similar to SQL.
77

88
## Features
99

10-
- Optional schema and rules validation, to prevent runtime surprises
10+
- Optional schema and rules validation
1111
- Basic boolean operations (`and` `or` and `not`) that allow to have any arbitrary complexity
1212
- Rules expressed in simple, easy to read JSON
1313
- Declarative conditional logic with [predicates](https://github.com/landau/predicate)
@@ -36,21 +36,16 @@ let rules = [{
3636
},
3737
event: {
3838
type: "remove",
39-
params: { fields: [ "password" ] },
39+
params: {
40+
fields: [ "password" ]
41+
},
4042
}
4143
}];
4244

43-
let schema = {
44-
properties: {
45-
firstName: { type: "string" },
46-
lastName: { type: "string" }
47-
}
48-
}
49-
5045
/**
5146
* Setup a new engine
5247
*/
53-
let engine = new Engine(rules, schema);
48+
let engine = new Engine(rules);
5449

5550
let formData = {
5651
lastName: "Smit"

0 commit comments

Comments
 (0)