Skip to content
This repository was archived by the owner on Feb 4, 2025. It is now read-only.

Commit b3c2426

Browse files
committed
fix: restored original API
1 parent e68d842 commit b3c2426

File tree

3 files changed

+17
-0
lines changed

3 files changed

+17
-0
lines changed

src/createJsonLogic.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ function createJsonLogic() {
8686
}
8787

8888
return {
89+
apply,
8990
add_operation: addOperation,
9091
rm_operation: removeOperation,
9192
add_visitor: addVisitor,

src/helpers/usesData.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,5 @@ function usesData(logic) {
2626

2727
return arrayUnique(collection);
2828
};
29+
30+
export default usesData;

src/index.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
import createJsonLogic from './createJsonLogic';
22
import * as operations from './operations';
33
import * as visitors from './visitors';
4+
import isLogic from "./helpers/isLogic";
5+
import truthy from "./helpers/truthy";
6+
import getOperator from "./helpers/getOperator";
7+
import getValues from "./helpers/getValues";
8+
import usesData from "./helpers/usesData";
9+
import ruleLike from "./helpers/ruleLike";
410

511
const jsonLogic = createJsonLogic();
612

@@ -16,4 +22,12 @@ Object.keys(visitors).forEach(function(name) {
1622
jsonLogic.add_visitor(visitor.code || name , visitor);
1723
});
1824

25+
// restore original public API
26+
jsonLogic.is_logic = isLogic;
27+
jsonLogic.truthy = truthy;
28+
jsonLogic.get_operator = getOperator;
29+
jsonLogic.get_values = getValues;
30+
jsonLogic.uses_data = usesData;
31+
jsonLogic.rule_like = ruleLike;
32+
1933
export default jsonLogic;

0 commit comments

Comments
 (0)